megengine.traced_module.traced_module.InternalGraph.get_node_by_id

InternalGraph.get_node_by_id(node_id=None, recursive=True)[源代码]

Filter Nodes by their id.

The id of the Node can be obtained by the following code

# node : Node
print("{:i}".format(node))
print(node.__format__("i"))
# graph : InternalGraph
print("{:i}".format(graph))
print(graph.__format__("i"))
参数
  • node_id (Optional[List[int]]) – a list of int.

  • recursive – whether to get the Nodes in the subgraph. Default: True

返回

A NodeFilterNodeId.