Skip to content

Commit fd38398

Browse files
committed
Use gather
Signed-off-by: Justin Chu <[email protected]>
1 parent c8ef89c commit fd38398

File tree

1 file changed

+2
-4
lines changed
  • onnxscript/function_libs/torch_lib/ops

1 file changed

+2
-4
lines changed

onnxscript/function_libs/torch_lib/ops/core.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8291,10 +8291,8 @@ def aten_swapdims(self: TensorType, dim0: int, dim1: int) -> TensorType:
82918291
@torch_op("aten::sym_size.int", trace_only=True)
82928292
def aten_sym_size(self: TensorType, dim: int = 0) -> INT64:
82938293
"""sym_size.int(Tensor self, int dim) -> SymInt"""
8294-
return op.Reshape(
8295-
op.Shape(self, end=dim + 1, start=dim),
8296-
op.Constant(value=ir.tensor([], dtype=ir.DataType.INT64)),
8297-
)
8294+
8295+
return op.Gather(op.Shape(self), dim, axis=0)
82988296

82998297

83008298
def aten_symeig(

0 commit comments

Comments
 (0)