mindspore.no_inline

View Source On Gitee
mindspore.no_inline(fn=None)[source]

Make the function to be reusable. The corresponding sub graph will not be inline.

Parameters

fn (function) – It is the python function. If it is a methon of a cell, please refer to mindspore.lazy_inline().

Returns

function, original function.

Supported Platforms:

Ascend

Examples

>>> from mindspore import no_inline, Tensor, jit
>>> @no_inline
... def no_inline_fun(val):
...     x = val * 3 + 2
...     return x
>>> @jit
... def call_no_inline_fun(val):
...     for _ in range(100):
...         val = no_inline_fun(val)
...     return val
>>> call_no_inline_fun(Tensor(10))