Skip to content

Commit 4c77f44

Browse files
hawkinspMagenta Team
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: 497026048
1 parent 7cb3c37 commit 4c77f44

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ddsp/colab/colab_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def get_tuning_factor(f0_midi, f0_confidence, mask_on):
231231
## Computes mininmum "note" transitions.
232232
f0_at = f0_midi[mask_on][:, np.newaxis] - midi_diffs
233233
f0_at_diffs = np.diff(f0_at, axis=0)
234-
deltas = (f0_at_diffs != 0.0).astype(np.float)
234+
deltas = (f0_at_diffs != 0.0).astype(float)
235235
cost_deltas = np.mean(weights[:-1] * deltas, axis=0)
236236

237237
# Tuning factor is minimum cost.

ddsp/training/heuristics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def strided_freq_change(controls,
256256
"""Finds changes in f0 of >= 1 semitone across multiple strides."""
257257
f0 = np.squeeze(controls['f0_hz'].numpy())
258258
f0_midi = ddsp.core.hz_to_midi(f0)
259-
transitions = np.ones(len(f0), dtype=np.bool)
259+
transitions = np.ones(len(f0), dtype=bool)
260260
for frame_width in frame_widths:
261261
padded_f0 = pad_for_frame(
262262
f0_midi, mode=pad_mode, frame_width=frame_width, axis=0)

0 commit comments

Comments
 (0)