Skip to content

Commit

Permalink
[numpy] Fix users of NumPy APIs that are removed in NumPy 2.0.
Browse files Browse the repository at this point in the history
This change migrates users of APIs removed in NumPy 2.0 to their recommended replacements (https://numpy.org/devdocs/numpy_2_0_migration_guide.html).

PiperOrigin-RevId: 655956468
  • Loading branch information
hawkinsp authored and copybara-github committed Jul 25, 2024
1 parent 77773cb commit 320e782
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tensorflow_graphics/util/tests/asserts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def test_select_eps_for_addition(self, dtype):
with self.assertRaises(tf.errors.InvalidArgumentError):
self.evaluate(tf.debugging.assert_equal(a, a + eps))

@parameterized.parameters((np.NaN,), (np.inf,))
@parameterized.parameters((np.nan,), (np.inf,))
@flagsaver.flagsaver(tfg_add_asserts_to_graph=False)
def test_assert_no_infs_or_nans_passthrough(self, value):
"""Checks that the assert is a passthrough when the flag is False."""
Expand All @@ -357,7 +357,7 @@ def test_assert_no_infs_or_nans_passthrough(self, value):

self.assertIs(vector_input, vector_output)

@parameterized.parameters((np.NaN,), (np.inf,))
@parameterized.parameters((np.nan,), (np.inf,))
def test_assert_no_infs_or_nans_raises_exception_for_nan(self, value):
"""Checks that the assert works for `Inf` or `NaN` values."""
vector_input = (value,)
Expand Down

0 comments on commit 320e782

Please sign in to comment.