Skip to content

Commit c9fcb24

Browse files
Arm backend: Add docstrings for operator_support/slice_copy_support.py (#15596)
Signed-off-by: Sebastian Larsson <[email protected]>
1 parent e487d29 commit c9fcb24

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

backends/arm/operator_support/slice_copy_support.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
#
33
# This source code is licensed under the BSD-style license found in the
44
# LICENSE file in the root directory of this source tree.
5+
"""Declare operator support for ``aten.slice_copy`` in TOSA.
56
7+
Support slicing with unit step only; emit a warning and reject otherwise.
8+
9+
"""
610

711
import logging
812

@@ -19,14 +23,24 @@
1923

2024
@register_tosa_support_check
2125
class SliceCopySupported(SupportedTOSAOperatorCheck):
26+
"""Provide TOSA support check for ``aten.slice_copy``."""
27+
2228
targets = [exir_ops.edge.aten.slice_copy.Tensor]
2329

2430
tosa_specs = [
2531
TosaSpecification.create_from_string("TOSA-1.0+INT"),
2632
TosaSpecification.create_from_string("TOSA-1.0+FP"),
2733
]
2834

29-
def is_node_tosa_supported(self, node: fx.Node, tosa_spec: TosaSpecification) -> bool: # type: ignore[override, misc]
35+
def is_node_tosa_supported(
36+
self, node: fx.Node, tosa_spec: TosaSpecification
37+
) -> bool: # type: ignore[override, misc]
38+
"""Return True if the node is supported by TOSA.
39+
40+
Accept slice_copy when the step is 1 (or unspecified). Warn and reject
41+
non-unit step sizes.
42+
43+
"""
3044
if tosa_spec not in self.tosa_specs:
3145
return False
3246

0 commit comments

Comments
 (0)