Commit 16e8323
Add tp_descr_get_impl infrastructure for descriptor protocol (#182213)
Summary:
Add infrastructure for modeling CPython's descriptor protocol in Dynamo:
- base.py: Route __get__ calls to tp_descr_get_impl when the VT implements it, mirroring CPython's slot_tp_descr_get.
- utils.py: Add is_torch_class helper to identify torch-internal classes whose C-level descriptors should go through trace_rules instead of descriptor VTs.
Authored with Claude.
X-link: pytorch/pytorch#182213
Approved by: https://github.com/guilhermeleobas
Reviewed By: huydhn
Differential Revision: D104188384
fbshipit-source-id: 3f9441312d389ece2d77c31beec8a9b05c35a1db1 parent 512df34 commit 16e8323
1 file changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4974 | 4974 | | |
4975 | 4975 | | |
4976 | 4976 | | |
| 4977 | + | |
| 4978 | + | |
| 4979 | + | |
| 4980 | + | |
| 4981 | + | |
| 4982 | + | |
| 4983 | + | |
| 4984 | + | |
| 4985 | + | |
| 4986 | + | |
| 4987 | + | |
| 4988 | + | |
| 4989 | + | |
4977 | 4990 | | |
4978 | 4991 | | |
4979 | 4992 | | |
| |||
0 commit comments