!23575 Add detail instruction of max_call_depth

Merge pull request !23575 from chenfei_mindspore/code_docs_max_call_depth
This commit is contained in:
i-robot 2021-09-17 01:35:04 +00:00 committed by Gitee
commit b2b622b99e
2 changed files with 4 additions and 1 deletions

View File

@ -202,6 +202,8 @@ EvalResultPtr BaseFuncGraphEvaluator::Eval(AnalysisEnginePtr engine, const Abstr
<< "It's always happened with complex construction of code or infinite recursion or loop.\n"
<< "Please check the code if it's has the infinite recursion "
<< "or call 'context.set_context(max_call_depth=value)' to adjust this value.\n"
<< "If max_call_depth is set larger, the system max stack depth should be set larger too "
<< "to avoid stack overflow.\n"
<< "For more details, please refer to the FAQ at https://www.mindspore.cn.";
}
MS_LOG(DEBUG) << this << "(" << type_name() << "/" << ToString()

View File

@ -702,7 +702,8 @@ def set_context(**kwargs):
of back propagation node outputs is the same as input parameters. Default: False.
max_call_depth (int): Specify the maximum depth of function call. Must be positive integer. Default: 1000.
The max_call_depth parameter needs to be set when the nested call is too deep or the number
of subgraphs is too large.
of subgraphs is too large. If max_call_depth is set larger than before, the system max stack depth should be
set larger too, otherwise a `core dumped` exception may be raised because of system stack overflow.
enable_sparse (bool): Whether to enable sparsity feature. Default: False.
For details of sparsity and sparse tensor, please check
`sparse tensor <https://www.mindspore.cn/docs/programming_guide/en/master/tensor.html#sparse-tensor>`_.