[NumPy] Remove references to deprecated NumPy type aliases.

This change replaces references to a number of deprecated NumPy type aliases (np.bool, np.int, np.float, np.complex, np.object, np.str) with their recommended replacement (bool, int, float, complex, object, str).

NumPy 1.24 drops the deprecated aliases, so we must remove uses before updating NumPy.

PiperOrigin-RevId: 497194550
This commit is contained in:
Peter Hawkins 2022-12-22 10:32:11 -08:00 committed by A. Unique TensorFlower
parent f99a74c7a4
commit 3d038a490a
2 changed files with 2 additions and 2 deletions

View file

@ -152,7 +152,7 @@ def rdp_gaussian(logq, sigma, orders):
if np.isscalar(orders):
return 0.
else:
return np.full_like(orders, 0., dtype=np.float)
return np.full_like(orders, 0., dtype=float)
variance = sigma**2

View file

@ -43,7 +43,7 @@ class DPOptimizerTest(tf.test.TestCase, parameterized.TestCase):
np.reshape(
per_example_gradients,
[num_microbatches,
np.int(batch_size / num_microbatches), num_vars]),
int(batch_size / num_microbatches), num_vars]),
axis=1)
microbatch_gradients_norms = np.linalg.norm(microbatch_gradients, axis=1)