File tree Expand file tree Collapse file tree 1 file changed +4
-15
lines changed
backends/cadence/fusion_g3/operators Expand file tree Collapse file tree 1 file changed +4
-15
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ Tensor& mean_out(
118
118
for (int i = 0 ; i < kNnlibMaxDim ; i++) {
119
119
out_shape[i] = 1 ;
120
120
inp_shape[i] = 1 ;
121
- p_axis[i] = 1 ;
121
+ p_axis[i] = - 1 ;
122
122
}
123
123
124
124
int num_axis_dims = prepare_data (
@@ -135,20 +135,10 @@ Tensor& mean_out(
135
135
num_out_dims = 1 ;
136
136
}
137
137
138
- int inp_shape_max = inp_shape[p_axis[0 ]];
139
- for (int i = 1 ; i < num_axis_dims; i++) {
140
- if (inp_shape[p_axis[i]] > inp_shape_max) {
141
- inp_shape_max = inp_shape[p_axis[i]];
142
- }
138
+ if ((out.dim () == 0 ) && (out.numel ())) {
139
+ num_out_dims = 1 ;
143
140
}
144
141
145
- int scratch_size = in.numel () / inp_shape_max;
146
-
147
- executorch::runtime::Result<void *> temp_mem =
148
- ctx.allocate_temp (scratch_size * sizeof (float ));
149
-
150
- void * __restrict__ p_scratch_in = (void * __restrict__)(temp_mem.get ());
151
-
152
142
XT_KERNEL_CHECK (
153
143
ctx,
154
144
out,
@@ -160,8 +150,7 @@ Tensor& mean_out(
160
150
inp_shape,
161
151
num_inp_dims,
162
152
p_axis,
163
- num_axis_dims,
164
- p_scratch_in);
153
+ num_axis_dims);
165
154
} else {
166
155
ET_KERNEL_CHECK (
167
156
ctx,
You can’t perform that action at this time.
0 commit comments