Get the module hierarchy of the given node.
(node: torch.fx.Node)
| 37 | |
| 38 | |
| 39 | def _get_module_hierarchy(node: torch.fx.Node) -> str: |
| 40 | """ |
| 41 | Get the module hierarchy of the given node. |
| 42 | """ |
| 43 | module_stack = node.meta.get("nn_module_stack") |
| 44 | if module_stack is not None and module_stack: |
| 45 | module_values_list = list(module_stack.values()) |
| 46 | if module_values_list: |
| 47 | return module_values_list[-1][0] |
| 48 | return "" |
| 49 | |
| 50 | |
| 51 | def create_tensor_allocation_info(graph: torch.fx.Graph) -> List[MemoryTimeline]: |
no test coverage detected