Skip to content

Commit bb84cd8

Browse files
[dynamo, 3.14] Ensure typing.Union is correctly traced in Dynamo.
Fixes `test_vector_norm_decom_unbacked_checks_cpu` from `test/test_linalg.py` on Python 3.14 ghstack-source-id: 03776e8 Pull-Request: #169084
1 parent a2973fb commit bb84cd8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

torch/_dynamo/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,10 @@ def istype(obj: object, allowed_types: Any) -> bool:
10651065
)
10661066

10671067

1068+
if sys.version_info >= (3, 14):
1069+
_builtin_final_typing_classes += (typing.Union,)
1070+
1071+
10681072
def is_typing(value: Any) -> bool:
10691073
# _Final catches most of typing classes:
10701074
# - Any

0 commit comments

Comments
 (0)