Skip to content

Commit e16c0b7

Browse files
csutertensorflower-gardener
authored andcommitted
Use onp in numpy_math.astuple; previous change to avoid int(ndarray) did not work.
PiperOrigin-RevId: 574584936
1 parent c1728d3 commit e16c0b7

File tree

1 file changed

+2
-1
lines changed
  • tensorflow_probability/python/internal/backend/numpy

1 file changed

+2
-1
lines changed

tensorflow_probability/python/internal/backend/numpy/numpy_math.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import collections
1818
import functools
1919
import numpy as np
20+
import numpy as onp # Disable JAX rewrite. # pylint: disable=reimported
2021

2122
from tensorflow_probability.python.internal.backend.numpy import _utils as utils
2223
from tensorflow_probability.python.internal.backend.numpy.numpy_array import _reverse
@@ -169,7 +170,7 @@ def _astuple(x):
169170
# In version 1.25 this was deprecated, causing a warning to be issued in the
170171
# below try/except. To avoid that, we just fall through in the case of an
171172
# np.ndarray.
172-
if not isinstance(x, np.ndarray):
173+
if not isinstance(x, onp.ndarray):
173174
try:
174175
return (int(x),)
175176
except TypeError:

0 commit comments

Comments
 (0)