(node: torch.fx.Node)
| 74 | class 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: |
no outgoing calls
no test coverage detected