oneflow.nn.Graph.__init__

Graph.__init__(*, enable_get_runtime_state_dict: bool = False, debug_v_level: int = - 1, debug_ranks: Optional[Union[int, List[int]]] = None, debug_max_py_stack_depth: int = 2, debug_only_user_py_stack=True, debug_op_repr_with_py_stack=False)

Initializes internal Graph states. It MUST be called in __init__ method of subclass.

For example:

>>> import oneflow as flow
>>> class CustomGraph(flow.nn.Graph):
...     def __init__(self):
...         super().__init__() # MUST be called
...         # Then define the graph attributes
...     def build(self):
...         pass