mindspore.ops.core

mindspore.ops.core(fn=None, **flags)[源代码]

A decorator that adds a flag to the function.

By default, the function is marked as True, enabling to use this decorator to set flag to a graph.

Parameters
  • fn (Function) – Function to add flag. Default: None.

  • flags (dict) – The following flags can be set core, which indicates that this is a core function or other flag. Default: None.

Supported Platforms:

Ascend GPU CPU

Examples

>>> net = Net()
>>> net = ops.core(net, predit=True)
>>> print(hasattr(net, '_func_graph_flags'))
True