Skip to content

Commit a52b998

Browse files
authored
Merge pull request #721 from OP2/JDBetteridge/numpy2_rebase
Support numpy 2.0
2 parents 7bef38f + c97a043 commit a52b998

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pyop2/codegen/representation.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def __init__(self, a, b):
285285
@cached_property
286286
def dtype(self):
287287
a, b = self.children
288-
return numpy.find_common_type([], [a.dtype, b.dtype])
288+
return numpy.result_type(a.dtype, b.dtype)
289289

290290

291291
class Sum(Scalar):
@@ -299,7 +299,7 @@ def __init__(self, a, b):
299299
@cached_property
300300
def dtype(self):
301301
a, b = self.children
302-
return numpy.find_common_type([], [a.dtype, b.dtype])
302+
return numpy.result_type(a.dtype, b.dtype)
303303

304304

305305
class Product(Scalar):
@@ -313,7 +313,7 @@ def __init__(self, a, b):
313313
@cached_property
314314
def dtype(self):
315315
a, b = self.children
316-
return numpy.find_common_type([], [a.dtype, b.dtype])
316+
return numpy.result_type(a.dtype, b.dtype)
317317

318318

319319
class QuotientBase(Scalar):
@@ -327,7 +327,7 @@ def __init__(self, a, b):
327327
@cached_property
328328
def dtype(self):
329329
a, b = self.children
330-
return numpy.find_common_type([], [a.dtype, b.dtype])
330+
return numpy.result_type(a.dtype, b.dtype)
331331

332332

333333
class Quotient(QuotientBase):

0 commit comments

Comments
 (0)