@@ -1188,10 +1188,9 @@ def _norm_int_axis(x, ord, axis, keepdims):
11881188 if x .shape [axis ] == 0 :
11891189 x = dpnp .moveaxis (x , axis , - 1 )
11901190 res_shape = x .shape [:- 1 ]
1191- result = dpnp .zeros_like (x , shape = res_shape )
11921191 if keepdims :
1193- result = result . reshape ( res_shape + (1 ,) )
1194- return result
1192+ res_shape += (1 ,)
1193+ return dpnp . zeros_like ( x , shape = res_shape )
11951194 return dpnp .abs (x ).max (axis = axis , keepdims = keepdims )
11961195 if ord == - dpnp .inf :
11971196 return dpnp .abs (x ).min (axis = axis , keepdims = keepdims )
@@ -1226,16 +1225,14 @@ def _norm_tuple_axis(x, ord, row_axis, col_axis, keepdims):
12261225
12271226 """
12281227
1229- # pylint: disable=too-many-branches
12301228 axis = (row_axis , col_axis )
12311229 flag = x .shape [row_axis ] == 0 or x .shape [col_axis ] == 0
12321230 if flag and ord in [1 , 2 , dpnp .inf ]:
12331231 x = dpnp .moveaxis (x , axis , (- 2 , - 1 ))
12341232 res_shape = x .shape [:- 2 ]
1235- result = dpnp .zeros_like (x , shape = res_shape )
12361233 if keepdims :
1237- result = result . reshape ( res_shape + (1 , 1 ) )
1238- return result
1234+ res_shape += (1 , 1 )
1235+ return dpnp . zeros_like ( x , shape = res_shape )
12391236 if row_axis == col_axis :
12401237 raise ValueError ("Duplicate axes given." )
12411238 if ord == 2 :
0 commit comments