Skip to content

Commit 3d038a4

Browse files
hawkinsptensorflower-gardener
authored andcommitted
[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
1 parent f99a74c commit 3d038a4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: research/pate_2018/core.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def rdp_gaussian(logq, sigma, orders):
152152
if np.isscalar(orders):
153153
return 0.
154154
else:
155-
return np.full_like(orders, 0., dtype=np.float)
155+
return np.full_like(orders, 0., dtype=float)
156156

157157
variance = sigma**2
158158

Diff for: tensorflow_privacy/privacy/optimizers/dp_optimizer_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def _compute_expected_gradients(self, per_example_gradients, l2_norm_clip,
4343
np.reshape(
4444
per_example_gradients,
4545
[num_microbatches,
46-
np.int(batch_size / num_microbatches), num_vars]),
46+
int(batch_size / num_microbatches), num_vars]),
4747
axis=1)
4848
microbatch_gradients_norms = np.linalg.norm(microbatch_gradients, axis=1)
4949

0 commit comments

Comments
 (0)