8000 remove guard_size_oblivious from unbind · pytorch/pytorch@b8544b0 · GitHub
[go: up one dir, main page]

Skip to content

Commit b8544b0

Browse files
committed
remove guard_size_oblivious from unbind
ghstack-source-id: d88a7cb Pull Request resolved: #148815
1 parent a39aaa3 commit b8544b0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

torch/_refs/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3988,14 +3988,15 @@ def unflatten(a: TensorLikeType, dim: int, sizes: ShapeType) -> TensorLikeType:
39883988

39893989
@register_decomposition(aten.unbind)
39903990
def unbind(t: TensorLikeType, dim: int = 0) -> TensorSequenceType:
3991-
from torch.fx.experimental.symbolic_shapes import guard_size_oblivious
3991+
from torch.fx.experimental.symbolic_shapes import guard_or_false
39923992

39933993
dim = utils.canonicalize_dim(t.ndim, dim)
39943994
torch._check_index(
39953995
len(t.shape) > 0,
39963996
lambda: "Dimension specified as 0 but tensor has no dimensions",
39973997
)
3998-
if guard_size_oblivious(t.shape[dim] == 0):
3998+
3999+
if guard_or_false(t.shape[dim] == 0):
39994000
return ()
40004001
else:
40014002
return tuple(

0 commit comments

Comments
 (0)
0