Skip to content

Commit

Permalink
Add inputsSize to Python IR, like outputsSize
Browse files Browse the repository at this point in the history
Test Plan:
Used it in some notebooks.

ghstack-source-id: ded2593d57c5ee6034e19f34cb1d267762ce9551
Pull Request resolved: pytorch#46779
  • Loading branch information
dreiss committed Oct 23, 2020
1 parent e0fd590 commit 90a8f21
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions torch/csrc/jit/python/python_ir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ void initPythonIRBindings(PyObject* module_) {
})
.def("sourceRange", [](Node& n) { return n.sourceRange().str(); })
.def("hasMultipleOutputs", [](Node& n) { return n.outputs().size() > 1; })
.def("inputsSize", [](Node& n) { return n.inputs().size(); })
.def("outputsSize", [](Node& n) { return n.outputs().size(); })
.NS(kind)
.def("inputsAt", [](Node& n, size_t i) { return n.inputs().at(i); })
Expand Down

0 comments on commit 90a8f21

Please sign in to comment.