Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions onnxscript/function_libs/torch_aten/ops/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1980,10 +1980,11 @@ def aten_gcd(self: TensorType, other: TensorType) -> TensorType:
raise NotImplementedError()


def aten_ge(self: TensorType, other: TensorType) -> TensorType:
@torch_op("aten::ge")
def aten_ge(self: TReal, other: TReal) -> BOOL:
# ge.Tensor(Tensor self, Tensor other) -> Tensor

raise NotImplementedError()
return op.Greater(self, other)


def aten_geqrf(self: TensorType) -> tuple[TensorType, TensorType]:
Expand Down Expand Up @@ -2867,10 +2868,11 @@ def aten_matrix_power(self: TensorType, n: int) -> TensorType:
raise NotImplementedError()


def aten_max(self: TensorType) -> TensorType:
@torch_op("aten::max")
def aten_max(self: TReal, dim: int, keepdim: BOOL = False) -> Tuple[TReal, INT64]:
# max(Tensor self) -> Tensor

raise NotImplementedError()
return op.Max(self)


def aten_max_pool1d(
Expand Down Expand Up @@ -2925,10 +2927,11 @@ def aten_max_pool3d(
raise NotImplementedError()


def aten_maximum(self: TensorType, other: TensorType) -> TensorType:
@torch_op("aten::maximum")
def aten_maximum(self: TReal, other: TReal) -> TReal:
# maximum(Tensor self, Tensor other) -> Tensor

raise NotImplementedError()
return op.Max(self, other)


def aten_mean(self: TensorType, dtype: Optional[int] = None) -> TensorType:
Expand Down
11 changes: 7 additions & 4 deletions onnxscript/test/function_libs/torch_aten/ops_correctness_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ def _topk_input_wrangler(
"acosh": core_ops.aten_acosh,
"add": core_ops.aten_add,
"addmm": core_ops.aten_addmm,
"amax": (core_ops.aten_amax, _amax_amin_input_wrangler),
"amin": (core_ops.aten_amin, _amax_amin_input_wrangler),
#"amax": (core_ops.aten_amax, _amax_amin_input_wrangler),
#"amin": (core_ops.aten_amin, _amax_amin_input_wrangler),
"arange_start_step": core_ops.aten_arange_start_step,
"arange_start": core_ops.aten_arange_start,
"arange": core_ops.aten_arange,
Expand All @@ -248,7 +248,7 @@ def _topk_input_wrangler(
"atanh": core_ops.aten_atanh,
"bmm": core_ops.aten_bmm,
"ceil": core_ops.aten_ceil,
"clamp_max": core_ops.aten_clamp_max,
#"clamp_max": core_ops.aten_clamp_max,
"clamp_min": core_ops.aten_clamp_min,
"clamp": core_ops.aten_clamp,
"clone": core_ops.aten_clone,
Expand All @@ -267,12 +267,13 @@ def _topk_input_wrangler(
"fmod": core_ops.aten_fmod,
"full": (core_ops.aten_full, _full_input_wrangler),
"full_like": core_ops.aten_full_like,
"ge": core_ops.aten_ge,
"gt": core_ops.aten_gt,
"isinf": core_ops.aten_isinf,
"log": core_ops.aten_log,
"log10": core_ops.aten_log10,
"log1p": core_ops.aten_log1p,
"log_softmax": (special_ops.aten_special_log_softmax, _log_softmax_input_wrangler),
#"log_softmax": (special_ops.aten_special_log_softmax, _log_softmax_input_wrangler),
"log2": core_ops.aten_log2,
"logaddexp": core_ops.aten_logaddexp,
"logaddexp2": core_ops.aten_logaddexp2,
Expand All @@ -281,6 +282,8 @@ def _topk_input_wrangler(
"logsumexp": (core_ops.aten_logsumexp, _logcumsumexp_input_wrangler),
"lt": core_ops.aten_lt,
"matmul": core_ops.aten_matmul,
"max": core_ops.aten_max,
"maximum": core_ops.aten_maximum,
"mm": core_ops.aten_mm,
"mul": core_ops.aten_mul,
"ne": core_ops.aten_ne,
Expand Down