From fc0a12ae3fc6a75310e430576077655089602164 Mon Sep 17 00:00:00 2001 From: Peter Hawkins Date: Thu, 25 Jul 2024 04:18:10 -0700 Subject: [PATCH] [numpy] Fix users of NumPy APIs that are removed in NumPy 2.0. 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 --- ffn/inference/segmentation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffn/inference/segmentation.py b/ffn/inference/segmentation.py index dee55df..a5abd17 100644 --- a/ffn/inference/segmentation.py +++ b/ffn/inference/segmentation.py @@ -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])