Skip to content
Merged
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
16 changes: 15 additions & 1 deletion backends/arm/operator_support/slice_copy_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
"""Declare operator support for ``aten.slice_copy`` in TOSA.

Support slicing with unit step only; emit a warning and reject otherwise.

"""

import logging

Expand All @@ -19,14 +23,24 @@

@register_tosa_support_check
class SliceCopySupported(SupportedTOSAOperatorCheck):
"""Provide TOSA support check for ``aten.slice_copy``."""

targets = [exir_ops.edge.aten.slice_copy.Tensor]

tosa_specs = [
TosaSpecification.create_from_string("TOSA-1.0+INT"),
TosaSpecification.create_from_string("TOSA-1.0+FP"),
]

def is_node_tosa_supported(self, node: fx.Node, tosa_spec: TosaSpecification) -> bool: # type: ignore[override, misc]
def is_node_tosa_supported(
self, node: fx.Node, tosa_spec: TosaSpecification
) -> bool: # type: ignore[override, misc]
"""Return True if the node is supported by TOSA.

Accept slice_copy when the step is 1 (or unspecified). Warn and reject
non-unit step sizes.

"""
if tosa_spec not in self.tosa_specs:
return False

Expand Down
Loading