@@ -1289,25 +1289,13 @@ cdef class usm_ndarray:
1289
1289
return dpctl.tensor.add(self , other, out = self )
1290
1290
1291
1291
def __iand__ (self , other ):
1292
- res = self .__and__ (other)
1293
- if res is NotImplemented :
1294
- return res
1295
- self .__setitem__ (Ellipsis , res)
1296
- return self
1292
+ return dpctl.tensor.bitwise_and(self , other, out = self )
1297
1293
1298
1294
def __ifloordiv__ (self , other ):
1299
- res = self .__floordiv__ (other)
1300
- if res is NotImplemented :
1301
- return res
1302
- self .__setitem__ (Ellipsis , res)
1303
- return self
1295
+ return dpctl.tensor.floor_divide(self , other, out = self )
1304
1296
1305
1297
def __ilshift__ (self , other ):
1306
- res = self .__lshift__ (other)
1307
- if res is NotImplemented :
1308
- return res
1309
- self .__setitem__ (Ellipsis , res)
1310
- return self
1298
+ return dpctl.tensor.bitwise_left_shift(self , other, out = self )
1311
1299
1312
1300
def __imatmul__ (self , other ):
1313
1301
res = self .__matmul__(other)
@@ -1317,52 +1305,28 @@ cdef class usm_ndarray:
1317
1305
return self
1318
1306
1319
1307
def __imod__ (self , other ):
1320
- res = self .__mod__ (other)
1321
- if res is NotImplemented :
1322
- return res
1323
- self .__setitem__ (Ellipsis , res)
1324
- return self
1308
+ return dpctl.tensor.remainder(self , other, out = self )
1325
1309
1326
1310
def __imul__ (self , other ):
1327
1311
return dpctl.tensor.multiply(self , other, out = self )
1328
1312
1329
1313
def __ior__ (self , other ):
1330
- res = self .__or__ (other)
1331
- if res is NotImplemented :
1332
- return res
1333
- self .__setitem__ (Ellipsis , res)
1334
- return self
1314
+ return dpctl.tensor.bitwise_or(self , other, out = self )
1335
1315
1336
1316
def __ipow__ (self , other ):
1337
- res = self .__pow__ (other, None )
1338
- if res is NotImplemented :
1339
- return res
1340
- self .__setitem__ (Ellipsis , res)
1341
- return self
1317
+ return dpctl.tensor.pow(self , other, out = self )
1342
1318
1343
1319
def __irshift__ (self , other ):
1344
- res = self .__rshift__ (other)
1345
- if res is NotImplemented :
1346
- return res
1347
- self .__setitem__ (Ellipsis , res)
1348
- return self
1320
+ return dpctl.tensor.bitwise_right_shift(self , other, out = self )
1349
1321
1350
1322
def __isub__ (self , other ):
1351
1323
return dpctl.tensor.subtract(self , other, out = self )
1352
1324
1353
1325
def __itruediv__ (self , other ):
1354
- res = self .__truediv__ (other)
1355
- if res is NotImplemented :
1356
- return res
1357
- self .__setitem__ (Ellipsis , res)
1358
- return self
1326
+ return dpctl.tensor.divide(self , other, out = self )
1359
1327
1360
1328
def __ixor__ (self , other ):
1361
- res = self .__xor__ (other)
1362
- if res is NotImplemented :
1363
- return res
1364
- self .__setitem__ (Ellipsis , res)
1365
- return self
1329
+ return dpctl.tensor.bitwise_xor(self , other, out = self )
1366
1330
1367
1331
def __str__ (self ):
1368
1332
return usm_ndarray_str(self )
0 commit comments