Implement serializable getattr support for tensor subclasses (#145772)

builtins.getattr is not serializable, so we replace it with a custom op that has more refined schema.

Differential Revision: [D68899421](https://our.internmc.facebook.com/intern/diff/D68899421)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/145772
Approved by: https://github.com/bdhirsh
This commit is contained in:
Tugsbayasgalan Manlaibaatar
2025-02-09 17:36:40 -08:00
committed by PyTorch MergeBot
parent d5d3bdb55a
commit ebd992724f
6 changed files with 48 additions and 38 deletions

View File

@ -64,6 +64,8 @@ __all__ = [
"UnflattenedModule",
]
# To make sure export specific custom ops are loaded
import torch.export.custom_ops
from .decomp_utils import CustomDecompTable
from .dynamic_shapes import Constraint, Dim, dims, ShapesCollection