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: 655904507
  • Loading branch information
hawkinsp authored and copybara-github committed Jul 25, 2024
1 parent f2b2b52 commit fc0a12a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ffn/inference/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def remap_input(x):
orig_values_map, x = np.unique(x, return_inverse=True)
if len(orig_values_map) > max_uint32:
raise ValueError('More than 2**32-1 unique labels not supported')
x = np.cast[np.uint64](x)
x = np.asarray(x, dtype=np.uint64)
if orig_values_map[0] != 0:
orig_values_map = np.concatenate(
[np.array([0], dtype=np.uint64), orig_values_map])
Expand Down

0 comments on commit fc0a12a

Please sign in to comment.