Skip to content

Commit

Permalink
Add inputsSize to Python IR, like outputsSize (#46779)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #46779

Test Plan: Used it in some notebooks.

Reviewed By: suo

Differential Revision: D24574005

Pulled By: dreiss

fbshipit-source-id: 78ba7a2bdb859fef5633212b73c7a3eb2cfbc380
  • Loading branch information
dreiss authored and facebook-github-bot committed Oct 28, 2020
1 parent 179d2b2 commit 23bce17
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 23bce17

Please sign in to comment.