Files
pytorch/torch/export/custom_obj.py
Sherlock Huang bb3db079b1 [Export] Introduce class_fqn into CustomObjArgument (#118158)
Summary:
Class FQN is needed when unpacking CustomObj instance.
For all other Arguments, e.g. Tensor, TensorList, SymInt, we always know their exact type. However, CustomObjArgument had an opaque type.
Adding this field also helps unveiling the type of this opaque object.

Test Plan: CI

Differential Revision: D53029847

Pull Request resolved: https://github.com/pytorch/pytorch/pull/118158
Approved by: https://github.com/zhxchen17
2024-01-25 18:44:25 +00:00

17 lines
296 B
Python

from dataclasses import dataclass
__all__ = ["ScriptObjectMeta"]
@dataclass
class ScriptObjectMeta:
"""
Metadata which is stored on nodes representing ScriptObjects.
"""
# Key into constants table to retrieve the real ScriptObject.
constant_name: str
class_fqn: str