Addresses #169073. Two changes:
TensorType (torch/fx/tensor_type.py) was using args and origin
to mimic a typing generic, but it's actually a domain type representing
tensor dimensions. Added adimsproperty and migrated all internal
usages from.__args__to.dims(the backing__args__attribute
is kept for backward compat). This removes the confusion about whether
TensorType should be accessed via typing.get_args().
Replaced all remaining
.__args__accesses on standard typing generics
(Union, List, Tuple, etc.) withtyping.get_args(), the recommended
public API. Covers operator_schemas, graph codegen, dynamo variables,
inductor fuzzer, datapipes typing, and several other modules.
Authored with Claude.
Pull Request resolved: #183006
Approved by: https://github.com/Skylion007