@@ -1104,6 +1104,7 @@ def __imod__(self, other: Array | float, /) -> Array:
1104
1104
"""
1105
1105
Performs the operation __imod__.
1106
1106
"""
1107
+ self ._check_type_device (other )
1107
1108
other = self ._check_allowed_dtypes (other , "real numeric" , "__imod__" )
1108
1109
if other is NotImplemented :
1109
1110
return other
@@ -1126,6 +1127,7 @@ def __imul__(self, other: Array | complex, /) -> Array:
1126
1127
"""
1127
1128
Performs the operation __imul__.
1128
1129
"""
1130
+ self ._check_type_device (other )
1129
1131
other = self ._check_allowed_dtypes (other , "numeric" , "__imul__" )
1130
1132
if other is NotImplemented :
1131
1133
return other
@@ -1148,6 +1150,7 @@ def __ior__(self, other: Array | int, /) -> Array:
1148
1150
"""
1149
1151
Performs the operation __ior__.
1150
1152
"""
1153
+ self ._check_type_device (other )
1151
1154
other = self ._check_allowed_dtypes (other , "integer or boolean" , "__ior__" )
1152
1155
if other is NotImplemented :
1153
1156
return other
@@ -1170,6 +1173,7 @@ def __ipow__(self, other: Array | complex, /) -> Array:
1170
1173
"""
1171
1174
Performs the operation __ipow__.
1172
1175
"""
1176
+ self ._check_type_device (other )
1173
1177
other = self ._check_allowed_dtypes (other , "numeric" , "__ipow__" )
1174
1178
if other is NotImplemented :
1175
1179
return other
@@ -1182,6 +1186,7 @@ def __rpow__(self, other: Array | complex, /) -> Array:
1182
1186
"""
1183
1187
from ._elementwise_functions import pow # type: ignore[attr-defined]
1184
1188
1189
+ self ._check_type_device (other )
1185
1190
other = self ._check_allowed_dtypes (other , "numeric" , "__rpow__" )
1186
1191
if other is NotImplemented :
1187
1192
return other
@@ -1193,6 +1198,7 @@ def __irshift__(self, other: Array | int, /) -> Array:
1193
1198
"""
1194
1199
Performs the operation __irshift__.
1195
1200
"""
1201
+ self ._check_type_device (other )
1196
1202
other = self ._check_allowed_dtypes (other , "integer" , "__irshift__" )
1197
1203
if other is NotImplemented :
1198
1204
return other
@@ -1215,6 +1221,7 @@ def __isub__(self, other: Array | complex, /) -> Array:
1215
1221
"""
1216
1222
Performs the operation __isub__.
1217
1223
"""
1224
+ self ._check_type_device (other )
1218
1225
other = self ._check_allowed_dtypes (other , "numeric" , "__isub__" )
1219
1226
if other is NotImplemented :
1220
1227
return other
@@ -1237,6 +1244,7 @@ def __itruediv__(self, other: Array | complex, /) -> Array:
1237
1244
"""
1238
1245
Performs the operation __itruediv__.
1239
1246
"""
1247
+ self ._check_type_device (other )
1240
1248
other = self ._check_allowed_dtypes (other , "floating-point" , "__itruediv__" )
1241
1249
if other is NotImplemented :
1242
1250
return other
@@ -1259,6 +1267,7 @@ def __ixor__(self, other: Array | int, /) -> Array:
1259
1267
"""
1260
1268
Performs the operation __ixor__.
1261
1269
"""
1270
+ self ._check_type_device (other )
1262
1271
other = self ._check_allowed_dtypes (other , "integer or boolean" , "__ixor__" )
1263
1272
if other is NotImplemented :
1264
1273
return other
0 commit comments