Skip to content
Open
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
7 changes: 5 additions & 2 deletions backends/nxp/aten_passes/decompose_split_to_slices_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

from typing import Optional, TypeAlias

import torch
Expand All @@ -10,6 +11,9 @@
from torch.fx.passes.infra.pass_base import PassBase, PassResult


SlicesArgs: TypeAlias = tuple[list[int], list[int], int]


class DecomposeSplitToSlicesPass(PassBase):
"""
The `split` operator returns multiple tensors by partitioning `x` along `dim`. Each partitioning can be done
Expand Down Expand Up @@ -103,8 +107,7 @@ def _create_slice_node(self, *slice_args) -> Node:

return slice_node

SlicesArgs: TypeAlias = tuple[list[int], list[int], int]

# noinspection PyMethodMayBeStatic
def _get_slices_args(self, split_node: Node) -> SlicesArgs:
split_nodes_chunks = split_node.meta["val"]
dim = 0 if len(split_node.args) < 3 else split_node.args[2]
Expand Down
Loading
Loading