Skip to content

Commit 2707ce3

Browse files
Arm backend: Remove function getNodeArgs (#13316)
The function was only used in one place and it was only a couple of lines so the logic was moved to where the function was originally called, which is in process_node.py. Signed-off-by: Sebastian Larsson <[email protected]>
1 parent 846bc1e commit 2707ce3

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

backends/arm/process_node.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from executorch.backends.arm.operators.node_visitor import NodeVisitor
1515
from executorch.backends.arm.tosa_mapping import TosaArg
1616
from executorch.backends.arm.tosa_specification import TosaSpecification
17-
from executorch.backends.arm.tosa_utils import getNodeArgs, tosa_shape
17+
from executorch.backends.arm.tosa_utils import tosa_shape
1818
from torch._export.utils import (
1919
get_buffer,
2020
get_lifted_tensor_constant,
@@ -33,7 +33,10 @@ def process_call_function(
3333
tosa_spec: TosaSpecification,
3434
):
3535
# Unpack arguments and convert
36-
inputs = getNodeArgs(node, tosa_spec)
36+
try:
37+
inputs = [TosaArg(arg, tosa_spec) for arg in node.args]
38+
except ValueError as e:
39+
raise ValueError(f"Failed processing args to op:\n{node}") from e
3740

3841
# Convert output (this node itself)
3942
try:

backends/arm/tosa_utils.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import torch
1717

18-
from executorch.backends.arm.tosa_mapping import extract_tensor_meta, TosaArg
18+
from executorch.backends.arm.tosa_mapping import extract_tensor_meta
1919

2020
from executorch.backends.arm.tosa_specification import TosaSpecification
2121
from executorch.exir.dialects._ops import ops as exir_ops
@@ -26,13 +26,6 @@
2626
logger = logging.getLogger(__name__)
2727

2828

29-
def getNodeArgs(node: Node, tosa_spec: TosaSpecification) -> list[TosaArg]:
30-
try:
31-
return [TosaArg(arg, tosa_spec) for arg in node.args]
32-
except ValueError as e:
33-
raise ValueError(f"Failed processing args to op:\n{node}") from e
34-
35-
3629
def are_fake_tensors_broadcastable(
3730
fake_tensors: list[FakeTensor],
3831
) -> tuple[bool, list[int]]:

0 commit comments

Comments
 (0)