Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
asi1024 committed Aug 16, 2023
1 parent 718ffbf commit f2b5351
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cupy/_indexing/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def __getitem__(self, key):
trans1d = self.trans1d
ndmin = self.ndmin
objs = []
arrays = []
scalars = []
if isinstance(key, str):
raise NotImplementedError
Expand All @@ -62,10 +63,11 @@ def __getitem__(self, key):
ndim = from_data.array(k, copy=False).ndim
if trans1d != -1 and ndim < ndmin:
newobj = self._output_obj(newobj, ndim, ndmin, trans1d)
arrays.append(newobj)

objs.append(newobj)

final_dtype = numpy.result_type(*key)
final_dtype = numpy.result_type(*arrays, *scalars)
if final_dtype is not None:
for k in scalars:
objs[k] = objs[k].astype(final_dtype)
Expand Down

0 comments on commit f2b5351

Please sign in to comment.