Skip to content

Commit 8d43ac4

Browse files
Arm backend: Update op_view for TOSA 1.0 (#10474)
Make op_view lower rank 0 outputs instead of raising an exception. Rank 0 outputs are triggered by test_amin.py and test_amax.py Signed-off-by: Oscar Andersson <[email protected]>
1 parent 8321a4a commit 8d43ac4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

backends/arm/operators/op_view.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ def define_node(
6363

6464
tosa_graph = cast(ts.TosaSerializer, tosa_graph)
6565

66-
if len(output.shape) == 0:
67-
raise ValueError(f"No output shape for {output}")
68-
69-
shape_len = len(output.shape)
70-
shape_data = list(tosa_shape(output.shape, output.dim_order))
66+
if len(output.shape) != 0:
67+
shape_len = len(output.shape)
68+
shape_data = list(tosa_shape(output.shape, output.dim_order))
69+
else:
70+
shape_len = 1
71+
shape_data = [0]
7172

7273
shape = tosa_graph.addConst(
7374
[shape_len],

0 commit comments

Comments
 (0)