mirror of
https://github.com/ROCm/jax.git
synced 2025-04-19 05:16:06 +00:00
Merge pull request #10385 from jakevdp:promote-types-comment
PiperOrigin-RevId: 443116925
This commit is contained in:
commit
606d1c2402
@ -327,6 +327,8 @@ def promote_types(a, b):
|
||||
Returns:
|
||||
A :class:`numpy.dtype` object.
|
||||
"""
|
||||
# Note: we deliberately avoid `if a in _weak_types` here because we want to check
|
||||
# object identity, not object equality, due to the behavior of np.dtype.__eq__
|
||||
a = a if any(a is t for t in _weak_types) else np.dtype(a)
|
||||
b = b if any(b is t for t in _weak_types) else np.dtype(b)
|
||||
return np.dtype(_least_upper_bound(a, b))
|
||||
|
Loading…
x
Reference in New Issue
Block a user