Skip to content

Commit dd9a512

Browse files
committed
up
1 parent 14b0ae4 commit dd9a512

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

backends/apple/coreml/compiler/torch_ops.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,16 @@
1414
from coremltools.converters.mil.frontend import _utils
1515
from coremltools.converters.mil.frontend.torch.ops import (
1616
_get_inputs,
17-
_get_kwinputs,
1817
NUM_TO_NUMPY_DTYPE,
1918
NUM_TO_TORCH_DTYPE,
2019
split,
21-
to,
2220
transpose,
2321
unbind,
2422
)
2523
from coremltools.converters.mil.frontend.torch.torch_op_registry import (
2624
register_torch_op,
2725
)
2826
from coremltools.converters.mil.mil import types
29-
from executorch.exir.dim_order_utils import get_memory_format
3027

3128

3229
# https://github.com/apple/coremltools/pull/2556
@@ -47,26 +44,6 @@ def split_copy(context, node):
4744
split(context, node)
4845

4946

50-
@register_torch_op(
51-
torch_alias=[
52-
"dim_order_ops::_to_dim_order_copy",
53-
"dim_order_ops._to_dim_order_copy",
54-
],
55-
override=False,
56-
)
57-
def _to_dim_order_copy(context, node):
58-
dim_order = _get_kwinputs(context, node, "dim_order", default=[None])[0]
59-
node.kwinputs.pop("dim_order")
60-
61-
# In CoreML, dim_order.val will be an ndarray, so we convert it to a list
62-
dim_order = [int(d) for d in dim_order.val]
63-
memory_format = get_memory_format(dim_order)
64-
assert (
65-
memory_format == _torch.contiguous_format
66-
), "Only contiguous memory format is supported in CoreML"
67-
to(context, node)
68-
69-
7047
# https://github.com/apple/coremltools/pull/2558
7148
@register_torch_op(
7249
torch_alias=["torchao::dequantize_affine", "torchao.dequantize_affine"],

0 commit comments

Comments
 (0)