File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -1663,7 +1663,6 @@ def slices_eval_getitem(
16631663 ne_args = {}
16641664 where : dict | None = kwargs .pop ("_where_args" , None )
16651665
1666- dtype = kwargs .pop ("dtype" , None )
16671666 if out is None :
16681667 # Compute the shape and chunks of the output array, including broadcasting
16691668 shape = compute_broadcast_shape (operands .values ())
@@ -1700,11 +1699,11 @@ def slices_eval_getitem(
17001699 new_expr = f"where({ expression } , _where_x, _where_y)"
17011700 result = ne_evaluate (new_expr , slice_operands , ** ne_args )
17021701
1703- if out is None :
1704- out = np . empty ( shape = result . shape , dtype = dtype )
1705- out [()] = result
1706-
1707- return out
1702+ if out is None : # avoid copying unnecessarily
1703+ return result
1704+ else :
1705+ out [()] = result
1706+ return out
17081707
17091708
17101709def infer_reduction_dtype (dtype , operation ):
You can’t perform that action at this time.
0 commit comments