pytorch
fcc10d75 - [JIT] Add property support to TorchScript classes (#42389)

Commit
4 years ago
[JIT] Add property support to TorchScript classes (#42389) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/42389 **Summary** This commit adds support for properties to TorchScript classes, specifically for getters and setters. They are implemented essentially as pointers to the methods that the corresponding decorators decorate, which are treated like regular class methods. Deleters for properties are considered to be out of scope (and probably useless for TorchScript anyway). **Test Plan** This commit adds a unit test for a class with a property that has both getter and setter and one that has only a getter. `python test/test_jit.py TestClassType.test_properties` Test Plan: Imported from OSS Reviewed By: eellison, ppwwyyxx Differential Revision: D22880232 Pulled By: SplitInfinity fbshipit-source-id: 4828640f4234cb3b0d4f3da4872a75fbf519e5b0
Author
Meghan Lele
Parents
Loading