pytorch/torch/csrc/jit/python
Mengwei Liu 10fc58620e [PyTorch][NASProfiler] Add moduleHierarchy Python API to print out hierarchical information about a Node (#60384)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/60384

Currently inlining module graph will drop module hierarchy info on Python side. Here we retrieve the module hierarchy from cpp side and expose it to a new Python API on Node called `moduleHierarchy()`.

Test Plan:
Usage:
```
torch._C._jit_pass_inline(module.graph)
torch._C._jit_pass_propagate_shapes_on_graph(module.graph)
node = module.graph.findNode("quantized::conv2d_relu")
'top(' + module.original_name + ').' + node.moduleHierarchy() + '.' + node.kind()
```
Output:
```
'top(QuantWrapper).module(FBNetHR).0(Sequential).xif0_0(ConvBNRelu).conv(ConvReLU2d).quantized::conv2d_relu'
```

Reviewed By: kimishpatel

Differential Revision: D29252169

fbshipit-source-id: 74163a87f919e061e5e75dfebc4c5cdbe8489d93
2021-06-30 01:32:31 -07:00
..
init.cpp [nnc] Get rid of fuser trigger counters (#57334) 2021-06-29 22:22:15 -07:00
init.h
module_python.h
pybind_utils.cpp [torch] Remove migration warning for ScriptDict 2021-06-03 20:55:40 -07:00
pybind_utils.h Support default values on NamedTuple fields (#54682) 2021-06-26 15:18:21 -07:00
pybind.h Make PyTorch code-base clang-tidy compliant (#56892) 2021-04-28 14:10:25 -07:00
python_arg_flatten.cpp Replace all direct cdata access with THPVariable_Unpack (#55799) 2021-04-15 08:57:04 -07:00
python_arg_flatten.h
python_custom_class.cpp Make PyTorch code-base clang-tidy compliant (#56892) 2021-04-28 14:10:25 -07:00
python_custom_class.h
python_dict.cpp [JIT] Add torch._C.ScriptDict (#52659) 2021-05-27 10:25:30 -07:00
python_dict.h [JIT] Add torch._C.ScriptDict (#52659) 2021-05-27 10:25:30 -07:00
python_interpreter.cpp Make PyTorch code-base clang-tidy compliant (#56892) 2021-04-28 14:10:25 -07:00
python_ir.cpp [PyTorch][NASProfiler] Add moduleHierarchy Python API to print out hierarchical information about a Node (#60384) 2021-06-30 01:32:31 -07:00
python_ir.h [PyTorch][NASProfiler] Add moduleHierarchy Python API to print out hierarchical information about a Node (#60384) 2021-06-30 01:32:31 -07:00
python_ivalue.h Make DataPtr extraction in CUDAFuture faster for Python values (#56918) 2021-05-06 01:12:53 -07:00
python_sugared_value.cpp Support default values on NamedTuple fields (#54682) 2021-06-26 15:18:21 -07:00
python_sugared_value.h Make PyTorch code-base clang-tidy compliant (#56892) 2021-04-28 14:10:25 -07:00
python_tracer.cpp
python_tracer.h
python_tree_views.cpp Make PyTorch code-base clang-tidy compliant (#56892) 2021-04-28 14:10:25 -07:00
python_tree_views.h
script_init.cpp [package] track storages across lifetime of PackageExporter (#59735) 2021-06-29 14:16:54 -07:00
script_init.h
update_graph_executor_opt.cpp Make PyTorch code-base clang-tidy compliant (#56892) 2021-04-28 14:10:25 -07:00
update_graph_executor_opt.h