[frontend] Expose real_type getter for torch.Argument (#91938)

Exposing an API to get real_type from an Argument. This is useful for Argument types such as SymInt.

Differential Revision: [D42425661](https://our.internmc.facebook.com/intern/diff/D42425661/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/91938
Approved by: https://github.com/ezyang
This commit is contained in:
Mengwei Liu
2023-01-11 21:36:08 +00:00
committed by PyTorch MergeBot
parent dc6916b341
commit 6676193b5e
2 changed files with 12 additions and 0 deletions

View File

@ -1719,6 +1719,8 @@ void initJITBindings(PyObject* module) {
py::class_<Argument>(m, "Argument")
.def_property_readonly("name", [](Argument& self) { return self.name(); })
.def_property_readonly("type", [](Argument& self) { return self.type(); })
.def_property_readonly(
"real_type", [](Argument& self) { return self.real_type(); })
.def_property_readonly(
"N",
[](Argument& self) -> py::object {