Skip to content

Commit 2e7d7c8

Browse files
hawkinsptensorflower-gardener
authored andcommitted
[NumPy] Fix uses of deprecated multidimensional NumPy indexing with a non-tuple index.
NumPy 1.23 removes support for non-tuple indexing of NumPy arrays (https://numpy.org/devdocs/release/1.23.0-notes.html#expired-deprecations). The workaround is to convert multidimensional indices to a tuple. PiperOrigin-RevId: 465319674
1 parent b0d85b1 commit 2e7d7c8

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def _confusion_matrix(
223223
if weights is None:
224224
weights = 1
225225
if not JAX_MODE:
226-
np.add.at(cmatrix, [labels, predictions], weights)
226+
np.add.at(cmatrix, (labels, predictions), weights)
227227
return cmatrix
228228
return cmatrix.at[(labels, predictions)].add(weights)
229229

0 commit comments

Comments
 (0)