File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
kernels/portable/cpu/util Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -85,10 +85,7 @@ size_t get_reduced_dim_product(
8585 }
8686 size_t dim_product = 1 ;
8787 if (!dim.has_value ()) {
88- for (size_t i = 0 ; i < static_cast <size_t >(in.dim ()); ++i) {
89- dim_product *= in.size (i);
90- }
91- return dim_product;
88+ return in.numel ();
9289 }
9390 const size_t d = _normalize_non_neg_d (dim.value (), in.dim ());
9491 return in.size (d);
@@ -107,10 +104,7 @@ size_t get_reduced_dim_product(
107104 size_t dim_product = 1 ;
108105 const size_t in_dim = in.dim ();
109106 if (!dim_list.has_value () || dim_list.value ().size () == 0 ) {
110- for (size_t i = 0 ; i < static_cast <size_t >(in.dim ()); ++i) {
111- dim_product *= in.size (i);
112- }
113- return dim_product;
107+ return in.numel ();
114108 }
115109 for (const auto & d : dim_list.value ()) {
116110 const size_t non_neg_d = _normalize_non_neg_d (d, in_dim);
You can’t perform that action at this time.
0 commit comments