Skip to content

Commit a421f57

Browse files
authored
Update tensor shape check for filtering
1 parent 777cc74 commit a421f57

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • onnxscript/function_libs/torch_lib/ops

onnxscript/function_libs/torch_lib/ops/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1540,7 +1540,7 @@ def aten_cat(tensors: Sequence[TTensor], dim: int = 0) -> TTensor:
15401540
if tensor is None:
15411541
continue
15421542
# Remove empty tensors
1543-
if tensor.shape is not None and 0 in tensor.shape:
1543+
if tensor.shape == (0,):
15441544
continue
15451545
filtered_tensors.append(tensor)
15461546
assert filtered_tensors, "aten::cat received all None or empty tensors"

0 commit comments

Comments
 (0)