Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trace_only for scripted ops using internal functions | feat(torchlib) #842

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions onnxscript/function_libs/torch_lib/ops/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,7 @@ def _complex_conjugate(self: TFloat) -> TFloat:
return conjugated


@torch_op("aten::conj", complex=True, trace_only=True)
@torch_op("aten::conj", complex=True)
def aten_conj_complex(self: TFloat) -> TFloat:
"""conj(Tensor(a) self) -> Tensor(a)"""

Expand Down Expand Up @@ -3749,7 +3749,7 @@ def aten_mH(self: TRealOrUInt8) -> TRealOrUInt8:
return op.Einsum(self, equation="...ij->...ji")


@torch_op("aten::mH", complex=True, trace_only=True)
@torch_op("aten::mH", complex=True)
def aten_mH_complex(self: TFloat) -> TFloat:
"""mH(Tensor(a) self) -> Tensor(a)"""

Expand Down
4 changes: 2 additions & 2 deletions onnxscript/tests/function_libs/torch_lib/ops_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ def _where_input_wrangler(
reason="fixme: ORT aborts with zero-dim tensors. https://github.com/microsoft/onnxruntime/issues/16619",
),
TorchLibOpInfo("conj", core_ops.aten_conj),
TorchLibOpInfo("conj", core_ops.aten_conj_complex, complex=True, trace_only=True),
TorchLibOpInfo("conj", core_ops.aten_conj_complex, complex=True),
TorchLibOpInfo("constant_pad_nd", core_ops.aten_constant_pad_nd),
# TorchLibOpInfo("copy", core_ops.aten_copy), # copy is not in OPS_DB
TorchLibOpInfo("cos", core_ops.aten_cos),
Expand Down Expand Up @@ -679,7 +679,7 @@ def _where_input_wrangler(
reason="this Aten overload can accept 2 inputs:(self, dim)",
),
TorchLibOpInfo("mH", core_ops.aten_mH),
TorchLibOpInfo("mH", core_ops.aten_mH_complex, complex=True, trace_only=True),
TorchLibOpInfo("mH", core_ops.aten_mH_complex, complex=True),
TorchLibOpInfo("mT", core_ops.aten_mT),
TorchLibOpInfo("mT", core_ops.aten_mT_complex, complex=True),
TorchLibOpInfo("min_dim", core_ops.aten_min_dim)
Expand Down
Loading