forked from 626_privacy/tensorflow_privacy
[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:
parent
f99a74c7a4
commit
3d038a490a
2 changed files with 2 additions and 2 deletions
|
@ -152,7 +152,7 @@ def rdp_gaussian(logq, sigma, orders):
|
||||||
if np.isscalar(orders):
|
if np.isscalar(orders):
|
||||||
return 0.
|
return 0.
|
||||||
else:
|
else:
|
||||||
return np.full_like(orders, 0., dtype=np.float)
|
return np.full_like(orders, 0., dtype=float)
|
||||||
|
|
||||||
variance = sigma**2
|
variance = sigma**2
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ class DPOptimizerTest(tf.test.TestCase, parameterized.TestCase):
|
||||||
np.reshape(
|
np.reshape(
|
||||||
per_example_gradients,
|
per_example_gradients,
|
||||||
[num_microbatches,
|
[num_microbatches,
|
||||||
np.int(batch_size / num_microbatches), num_vars]),
|
int(batch_size / num_microbatches), num_vars]),
|
||||||
axis=1)
|
axis=1)
|
||||||
microbatch_gradients_norms = np.linalg.norm(microbatch_gradients, axis=1)
|
microbatch_gradients_norms = np.linalg.norm(microbatch_gradients, axis=1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue