Skip to content

Commit

Permalink
Use onp in numpy_math.astuple; previous change to avoid int(ndarray) …
Browse files Browse the repository at this point in the history
…did not work.

PiperOrigin-RevId: 574584936
  • Loading branch information
csuter authored and tensorflower-gardener committed Oct 18, 2023
1 parent c1728d3 commit e16c0b7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import collections
import functools
import numpy as np
import numpy as onp # Disable JAX rewrite. # pylint: disable=reimported

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

0 comments on commit e16c0b7

Please sign in to comment.