8000 [easy][AOT] Fix shortcut path for simple tuple/list spec (#118460) · pytorch/pytorch@2728c91 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2728c91

Browse files
XuehaiPanpytorchmergebot
authored andcommitted
[easy][AOT] Fix shortcut path for simple tuple/list spec (#118460)
`type(self.spec)` is always `TreeSpec` and the condition is always `False`. This PR changes it to `self.spec.type`, which is the type of tree that the spec represents. Pull Request resolved: #118460 Approved by: https://github.com/Skylion007
1 parent 1460334 commit 2728c91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch/_functorch/_aot_autograd/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def set(self, spec: pytree.TreeSpec) -> None:
126126
assert self.spec is None or self.spec == spec
127127
assert spec is not None
128128
self.spec: pytree.TreeSpec = spec
129-
if type(self.spec) in {tuple, list} and all(
129+
if self.spec.type in {tuple, list} and all(
130130
child.is_leaf() for child in spec.children_specs
131131
):
132132
self.is_simple = True

0 commit comments

Comments
 (0)
0