Skip to content

Commit

Permalink
Update core.py
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaowuhu committed Jul 8, 2024
1 parent 4455dd3 commit c21f6ac
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions onnxscript/function_libs/torch_lib/ops/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6657,10 +6657,18 @@ def aten_prelu_backward(
raise NotImplementedError()


def aten_prod(self: TensorType, dtype: Optional[int] = None) -> TensorType:
@torch_op(("aten::prod"), trace_only=True)
def aten_prod(self: TReal, dtype: Optional[int] = None) -> TReal:
"""prod(Tensor self, *, ScalarType? dtype=None) -> Tensor"""

raise NotImplementedError()
return op.ReduceProd(self)


@torch_op("aten::prod.dim_int", trace_only=True)
def aten_prod_dim(self: TReal, dim: int, keepdim: bool = False, dtype: Optional[int] = None) -> TReal:
"""prod(Tensor self, *, ScalarType? dtype=None) -> Tensor"""

return op.ReduceProd(self, axes=dim, keepdims=keepdim)


def aten_promote_types(type1: int, type2: int) -> int:
Expand Down

0 comments on commit c21f6ac

Please sign in to comment.