megengine.traced_module#

>>> import megengine.traced_module as tm

TracedModule

TracedModule is the Module created by tracing normal module.

trace_module

Traces module mod and returns corresponding TracedModule.

register_as_builtin

Registers class mod_cls (subclass of Module) as builtin module.

wrap

Call this function to register func as a builtin function.

Node#

ModuleNode

ModuleNode represents the Module objects.

TensorNode

TensorNode represents the Tensor objects.

Expr#

Input

A fake Expr which is used to mark the input of graph.

GetAttr

Getattr represents the fetch of an attribute from the Module hierarchy.

CallMethod

CallMethod represents a call to the __call__ method of Module or a method of Tensor.

CallFunction

CallFunction represents a call to a built-in function.

Constant

Constant represents a Tensor or "Module" which is not the attribute of a Module.

Apply

Apply represents a call to apply.

InternalGraph#

InternalGraph

InternalGraph is the main data structure used in the TracedModule.