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-poisoned]
  • Loading branch information
dreiss committed Oct 23, 2020
1 parent f2e5ae4 commit 63163e8
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 63163e8

Please sign in to comment.