mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-22 14:15:01 +08:00
Add debug repr to SymNode (#129925)
Fixes #129403 Create a separate printing function to debug SymNode, since we can't easily change `__repr__` that is used by GraphModule.recompile() to create a pythonic version of a graph This is my first contribution, please let me know if there is anything that I should look into in further details Thank you for you guidance! 🙏 I hope to contribute more in the future! @aorenste Pull Request resolved: https://github.com/pytorch/pytorch/pull/129925 Approved by: https://github.com/aorenste
This commit is contained in:
committed by
PyTorch MergeBot
parent
2c4303c1d1
commit
43b98fa521
@ -1284,6 +1284,9 @@ void initJITBindings(PyObject* module) {
|
||||
.def(
|
||||
"__repr__",
|
||||
[](c10::SymNode a) { return a->str(); })
|
||||
.def(
|
||||
"_graph_repr",
|
||||
[](c10::SymNode a) { return a->_graph_repr(); })
|
||||
.def(
|
||||
"is_constant",
|
||||
[](const c10::SymNode& node){
|
||||
|
Reference in New Issue
Block a user