Skip to content

Commit e7be6a6

Browse files
Fix KeyError: 'descr' (#938)
Co-authored-by: Alexander-Makaryev <[email protected]>
1 parent a7e60ea commit e7be6a6

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

dpnp/dpnp_iface_libmath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def erf(in_array1):
7979

8080
x1_desc = dpnp.get_dpnp_descriptor(in_array1)
8181
if x1_desc:
82-
return dpnp_erf(x1_desc)
82+
return dpnp_erf(x1_desc).get_pyobj()
8383

8484
result = create_output_descriptor_py(in_array1.shape, in_array1.dtype, None).get_pyobj()
8585
for i in range(result.size):

dpnp/dpnp_iface_manipulation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def moveaxis(x1, source, destination):
397397
# checker_throw_value_error("swapaxes", "source_id exists", source_id, input_permute)
398398
input_permute.insert(destination_id, source_id)
399399

400-
return transpose(x1_desc, axes=input_permute)
400+
return transpose(x1_desc.get_pyobj(), axes=input_permute)
401401

402402
return call_origin(numpy.moveaxis, x1, source, destination)
403403

@@ -515,7 +515,7 @@ def rollaxis(x1, axis, start=0):
515515
start_norm = start + x1_desc.ndim if start < 0 else start
516516
destination = start_norm - 1 if start_norm > axis else start_norm
517517

518-
return dpnp.moveaxis(x1_desc, axis, destination)
518+
return dpnp.moveaxis(x1_desc.get_pyobj(), axis, destination)
519519

520520
return call_origin(numpy.rollaxis, x1, axis, start)
521521

@@ -610,7 +610,7 @@ def swapaxes(x1, axis1, axis2):
610610
# swap axes
611611
input_permute[axis1], input_permute[axis2] = input_permute[axis2], input_permute[axis1]
612612

613-
return transpose(x1_desc, axes=input_permute)
613+
return transpose(x1_desc.get_pyobj(), axes=input_permute)
614614

615615
return call_origin(numpy.swapaxes, x1, axis1, axis2)
616616

dpnp/dpnp_iface_mathematical.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def copysign(x1, x2, dtype=None, out=None, where=True, **kwargs):
380380
elif not where:
381381
pass
382382
else:
383-
return dpnp_copysign(x1_desc, x2_desc, dtype=dtype, out=out, where=where)
383+
return dpnp_copysign(x1_desc, x2_desc, dtype=dtype, out=out, where=where).get_pyobj()
384384

385385
return call_origin(numpy.copysign, x1, x2, dtype=dtype, out=out, where=where, **kwargs)
386386

@@ -1154,7 +1154,7 @@ def nancumprod(x1, **kwargs):
11541154

11551155
x1_desc = dpnp.get_dpnp_descriptor(x1)
11561156
if x1_desc and not kwargs:
1157-
return dpnp_nancumprod(x1_desc)
1157+
return dpnp_nancumprod(x1_desc).get_pyobj()
11581158

11591159
return call_origin(numpy.nancumprod, x1, **kwargs)
11601160

@@ -1190,7 +1190,7 @@ def nancumsum(x1, **kwargs):
11901190

11911191
x1_desc = dpnp.get_dpnp_descriptor(x1)
11921192
if x1_desc and not kwargs:
1193-
return dpnp_nancumsum(x1_desc)
1193+
return dpnp_nancumsum(x1_desc).get_pyobj()
11941194

11951195
return call_origin(numpy.nancumsum, x1, **kwargs)
11961196

dpnp/fft/dpnp_iface_fft.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ def ifftn(x1, s=None, axes=None, norm=None):
404404
checker_throw_axis_error("fft.ifftn", "is out of bounds", param_axis, f"< {len(boundaries)}")
405405

406406
x1_iter_desc = dpnp.get_dpnp_descriptor(x1_iter)
407-
x1_iter = ifft(x1_iter_desc, n=param_n, axis=param_axis, norm=norm)
407+
x1_iter = ifft(x1_iter_desc.get_pyobj(), n=param_n, axis=param_axis, norm=norm)
408408

409409
return x1_iter
410410

@@ -517,7 +517,7 @@ def irfft2(x1, s=None, axes=(-2, -1), norm=None):
517517
if norm is not None:
518518
pass
519519
else:
520-
return irfftn(x1_desc, s, axes, norm)
520+
return irfftn(x1_desc.get_pyobj(), s, axes, norm)
521521

522522
return call_origin(numpy.fft.irfft2, x1, s, axes, norm)
523523

@@ -564,7 +564,7 @@ def irfftn(x1, s=None, axes=None, norm=None):
564564
checker_throw_axis_error("fft.irfftn", "is out of bounds", param_axis, f"< {len(boundaries)}")
565565

566566
x1_iter_desc = dpnp.get_dpnp_descriptor(x1_iter)
567-
x1_iter = irfft(x1_iter_desc, n=param_n, axis=param_axis, norm=norm)
567+
x1_iter = irfft(x1_iter_desc.get_pyobj(), n=param_n, axis=param_axis, norm=norm)
568568

569569
return x1_iter
570570

@@ -632,7 +632,7 @@ def rfft2(x1, s=None, axes=(-2, -1), norm=None):
632632
if norm is not None:
633633
pass
634634
else:
635-
return rfftn(x1_desc, s, axes, norm)
635+
return rfftn(x1_desc.get_pyobj(), s, axes, norm)
636636

637637
return call_origin(numpy.fft.rfft2, x1, s, axes, norm)
638638

@@ -696,7 +696,7 @@ def rfftn(x1, s=None, axes=None, norm=None):
696696
checker_throw_axis_error("fft.rfftn", "is out of bounds", param_axis, f"< {len(boundaries)}")
697697

698698
x1_iter_desc = dpnp.get_dpnp_descriptor(x1_iter)
699-
x1_iter = rfft(x1_iter_desc, n=param_n, axis=param_axis, norm=norm)
699+
x1_iter = rfft(x1_iter_desc.get_pyobj(), n=param_n, axis=param_axis, norm=norm)
700700

701701
return x1_iter
702702

0 commit comments

Comments
 (0)