Skip to content

Commit 0b68c70

Browse files
committed
up
1 parent dd9a512 commit 0b68c70

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

backends/apple/coreml/compiler/torch_ops.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
import torch as _torch
1313
from coremltools import _logger
1414
from coremltools.converters.mil.frontend import _utils
15+
from coremltools.converters.mil.frontend.torch.dom_order_ops import (
16+
_empty_dim_order,
17+
_to_dim_order_copy,
18+
)
1519
from coremltools.converters.mil.frontend.torch.ops import (
1620
_get_inputs,
1721
NUM_TO_NUMPY_DTYPE,
@@ -44,6 +48,20 @@ def split_copy(context, node):
4448
split(context, node)
4549

4650

51+
# This is a temporary hack to register the alias "dim_order_ops._to_dim_order_copy",
52+
# which was missed by coremltools
53+
@register_torch_op(torch_alias=["dim_order_ops._to_dim_order_copy"], override=False)
54+
def _to_dim_order_copy_TMP_EXECUTORCH_ALIAS_HACK(context, node):
55+
return _to_dim_order_copy(context, node)
56+
57+
58+
# This is a temporary hack to register the alias "dim_order_ops._empty_dim_order",
59+
# which was missed by coremltools
60+
@register_torch_op(torch_alias=["dim_order_ops._empty_dim_order"], override=False)
61+
def _empty_dim_order_TMP_EXECUTORCH_ALIAS_HACK(context, node):
62+
return _empty_dim_order(context, node)
63+
64+
4765
# https://github.com/apple/coremltools/pull/2558
4866
@register_torch_op(
4967
torch_alias=["torchao::dequantize_affine", "torchao.dequantize_affine"],

0 commit comments

Comments
 (0)