mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary: The code uses `torch::jit::jit_log_prefix` for handling recursive indenting in most places in this function. There was one place that was using "level", but it was buggy -- it would result in a compounding superlinear indent. Note that changing it to "level+1" doesn't fix the bug. Before/after: https://gist.github.com/silvasean/8ee3ef115a48de6c9c54fbc40838d8d7 The new code establishes a recursive invariant for `Module::dump_to_str`: the function returns the module printed at the base indent level (i.e. no indent). `torch::jit:log_prefix` is used to prefix recursive calls. The code was already nearly there, except for this spurious use of "level". Pull Request resolved: https://github.com/pytorch/pytorch/pull/52539 Reviewed By: navahgar Differential Revision: D26773657 Pulled By: gmagogsfm fbshipit-source-id: ab476f0738bf07de9f40d168dd038dbf62a9a79e |
||
|---|---|---|
| .. | ||
| init.cpp | ||
| init.h | ||
| module_python.h | ||
| pybind_utils.cpp | ||
| pybind_utils.h | ||
| pybind.h | ||
| python_arg_flatten.cpp | ||
| python_arg_flatten.h | ||
| python_custom_class.cpp | ||
| python_custom_class.h | ||
| python_interpreter.cpp | ||
| python_ir.cpp | ||
| python_ir.h | ||
| python_ivalue.h | ||
| python_sugared_value.cpp | ||
| python_sugared_value.h | ||
| python_tracer.cpp | ||
| python_tracer.h | ||
| python_tree_views.cpp | ||
| python_tree_views.h | ||
| script_init.cpp | ||
| script_init.h | ||
| update_graph_executor_opt.cpp | ||
| update_graph_executor_opt.h | ||