MCPcopy Create free account
hub / github.com/pytorch/executorch / _get_node_name

Method _get_node_name

devtools/debug_format/et_schema.py:76–87  ·  view source on GitHub ↗
(node: torch.fx.Node)

Source from the content-addressed store, hash-verified

74class FXOperatorGraph(OperatorGraph):
75 @staticmethod
76 def _get_node_name(node: torch.fx.Node) -> str:
77 if node.target == operator.getitem:
78 # pyre-ignore[9]: Incompatible variable type
79 node = node.args[0]
80 assert isinstance(
81 node, torch.fx.Node
82 ), f"First argument of getitem must be a torch fx node. Got {node.args[0]}"
83
84 # Adding the "_" to the node name prevents TensorBoard from collapsing
85 # nodes with similar names that only differ by an integer at the end of
86 # their name.
87 return node.name + "_"
88
89 @staticmethod
90 def _get_op_name(node: torch.fx.Node) -> str:

Callers 2

_parse_argsMethod · 0.80
gen_operator_graphMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected