41
41
42
42
43
43
from dpnp .dpnp_algo import *
44
- from dpnp .dparray import dparray
45
44
from dpnp .dpnp_utils import *
46
45
47
46
import dpnp
@@ -196,16 +195,15 @@ def add(x1, x2, dtype=None, out=None, where=True, **kwargs):
196
195
pass
197
196
elif x2_desc and x2_desc .ndim == 0 :
198
197
pass
199
- elif out is not None and not isinstance (out , dparray ):
200
- pass
201
198
elif dtype is not None :
202
199
pass
203
200
elif out is not None :
204
201
pass
205
202
elif not where :
206
203
pass
207
204
else :
208
- return dpnp_add (x1_desc , x2_desc , dtype = dtype , out = out , where = where ).get_pyobj ()
205
+ out_desc = dpnp .get_dpnp_descriptor (out ) if out is not None else None
206
+ return dpnp_add (x1_desc , x2_desc , dtype , out_desc , where ).get_pyobj ()
209
207
210
208
return call_origin (numpy .add , x1 , x2 , dtype = dtype , out = out , where = where , ** kwargs )
211
209
@@ -750,8 +748,6 @@ def floor_divide(x1, x2, dtype=None, out=None, where=True, **kwargs):
750
748
pass
751
749
elif x1_desc and x2_desc and x1_desc .shape != x2_desc .shape :
752
750
pass
753
- elif out is not None and not isinstance (out , dparray ):
754
- pass
755
751
elif dtype is not None :
756
752
pass
757
753
elif out is not None :
@@ -761,7 +757,8 @@ def floor_divide(x1, x2, dtype=None, out=None, where=True, **kwargs):
761
757
elif x1_is_scalar and x2_desc .ndim > 1 :
762
758
pass
763
759
else :
764
- return dpnp_floor_divide (x1_desc , x2_desc , out = out , where = where , dtype = dtype )
760
+ out_desc = dpnp .get_dpnp_descriptor (out ) if out is not None else None
761
+ return dpnp_floor_divide (x1_desc , x2_desc , dtype , out_desc , where )
765
762
766
763
return call_origin (numpy .floor_divide , x1 , x2 , out = out , where = where , dtype = dtype , ** kwargs )
767
764
@@ -854,16 +851,15 @@ def fmod(x1, x2, dtype=None, out=None, where=True, **kwargs):
854
851
pass
855
852
elif x2_desc and x2 .ndim == 0 :
856
853
pass
857
- elif out is not None and not isinstance (out , dparray ):
858
- pass
859
854
elif dtype is not None :
860
855
pass
861
856
elif out is not None :
862
857
pass
863
858
elif not where :
864
859
pass
865
860
else :
866
- return dpnp_fmod (x1_desc , x2_desc , dtype = dtype , out = out , where = where ).get_pyobj ()
861
+ out_desc = dpnp .get_dpnp_descriptor (out ) if out is not None else None
862
+ return dpnp_fmod (x1_desc , x2_desc , dtype , out_desc , where ).get_pyobj ()
867
863
868
864
return call_origin (numpy .fmod , x1 , x2 , dtype = dtype , out = out , where = where , ** kwargs )
869
865
@@ -1438,8 +1434,6 @@ def remainder(x1, x2, out=None, where=True, dtype=None, **kwargs):
1438
1434
pass
1439
1435
elif x1_desc and x2_desc and x1_desc .shape != x2_desc .shape :
1440
1436
pass
1441
- elif out is not None and not isinstance (out , dparray ):
1442
- pass
1443
1437
elif dtype is not None :
1444
1438
pass
1445
1439
elif out is not None :
@@ -1449,7 +1443,8 @@ def remainder(x1, x2, out=None, where=True, dtype=None, **kwargs):
1449
1443
elif x1_is_scalar and x2_desc .ndim > 1 :
1450
1444
pass
1451
1445
else :
1452
- return dpnp_remainder (x1_desc , x2_desc , out = out , where = where , dtype = dtype )
1446
+ out_desc = dpnp .get_dpnp_descriptor (out ) if out is not None else None
1447
+ return dpnp_remainder (x1_desc , x2_desc , dtype , out_desc , where )
1453
1448
1454
1449
return call_origin (numpy .remainder , x1 , x2 , out = out , where = where , dtype = dtype , ** kwargs )
1455
1450
0 commit comments