(node: torch.fx.Node)
| 32 | |
| 33 | @staticmethod |
| 34 | def from_node(node: torch.fx.Node) -> ATenDebugSchema: |
| 35 | # node.target is Union[Callable[..., Any], str], so we need to access this correctly depending on the type |
| 36 | if callable(node.target): |
| 37 | operator_name = node.target.__name__ |
| 38 | else: |
| 39 | operator_name = node.target |
| 40 | |
| 41 | return ATenDebugSchema(node_name=node.name, operator_name=operator_name) |
| 42 | |
| 43 | |
| 44 | @dataclass |