mindspore.set_recursion_limit

View Source On Gitee
mindspore.set_recursion_limit(recursion_limit=1000)[source]

Specify the recursion depth limit of function call before compiling graph. It needs to be call when the nested function call is too deep or the number of sub graphs is too large. If recursion_limit 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.

Parameters

recursion_limit (int, optional) – The recursion depth limit. Must be a positive integer. Default: 1000 .

Examples

>>> import mindspore as ms
>>> ms.set_recursion_limit(10000)