File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 6
6
# pyre-unsafe
7
7
from typing import Any , List
8
8
9
- import numpy as np
10
9
import torch
11
10
12
11
from executorch .backends .arm ._passes .fold_qdq_with_annotated_qparams_pass import (
@@ -333,21 +332,22 @@ def define_node(
333
332
weight .dtype ,
334
333
)
335
334
shape = tosa_graph .addConst (
336
- np . array (weight_post_shape ). shape ,
335
+ [ len (weight_post_shape )] ,
337
336
ts .DType .SHAPE ,
338
- np . array ( weight_post_shape ) ,
337
+ weight_post_shape ,
339
338
name = weight_reshaped .name + "_shape" ,
340
339
)
341
340
342
- attr = ts .TosaSerializerAttribute ()
343
- attr .ReshapeAttribute ()
341
+ reshape_attr = ts .TosaSerializerAttribute ()
342
+ reshape_attr .ReshapeAttribute ()
344
343
tosa_graph .addOperator (
345
344
ts .TosaOp .Op ().RESHAPE ,
346
345
[weight .name , shape .name ],
347
346
[weight_reshaped .name ],
348
- attr ,
347
+ reshape_attr ,
349
348
)
350
349
350
+ attr = ts .TosaSerializerAttribute ()
351
351
tosa_op = ts .TosaOp .Op ().DEPTHWISE_CONV2D
352
352
weight_name = weight_reshaped .name
353
353
Original file line number Diff line number Diff line change @@ -74,14 +74,14 @@ def define_node(
74
74
tosa_graph = cast (ts .TosaSerializer , tosa_graph )
75
75
76
76
if len (output .shape ) != 0 :
77
- shape_len = len (output .shape )
77
+ shape_len = [ len (output .shape )]
78
78
shape_data = list (tosa_shape (output .shape , output .dim_order ))
79
79
else :
80
- shape_len = 1
81
- shape_data = [0 ]
80
+ shape_len = []
81
+ shape_data = []
82
82
83
83
shape = tosa_graph .addConst (
84
- [ shape_len ] ,
84
+ shape_len ,
85
85
ts .DType .SHAPE ,
86
86
shape_data ,
87
87
name = node .name + "_shape" ,
You can’t perform that action at this time.
0 commit comments