Skip to content

Commit

Permalink
[NumPy] Remove references to deprecated NumPy type aliases.
Browse files Browse the repository at this point in the history
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: 497189015
  • Loading branch information
hawkinsp authored and Copybara-Service committed Dec 26, 2022
1 parent c28c6fa commit bb5ccef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vmoe/evaluate/fewshot_test.py
Expand Up @@ -106,7 +106,7 @@ def setUp(self):
valid = np.concatenate([
np.ones((3, 16)),
np.concatenate([np.ones((1, 12)), np.zeros((1, 4))], axis=1),
], axis=0).astype(np.bool)
], axis=0).astype(bool)
dataset = tf.data.Dataset.from_tensor_slices({
'image': images,
'label': labels,
Expand Down
2 changes: 1 addition & 1 deletion vmoe/moe_test.py
Expand Up @@ -251,7 +251,7 @@ def test_top_items_per_expert_einsum(self):
dispatcher.dispatch_weights,
np.asarray([[[0, 1], [0, 0], [0, 0]],
[[1, 0], [0, 1], [0, 1]],
[[0, 0], [1, 0], [1, 0]]], dtype=np.bool))
[[0, 0], [1, 0], [1, 0]]], dtype=bool))
np.testing.assert_array_almost_equal(
dispatcher.combine_weights,
np.asarray([[[.0, .4], [.0, .0], [.0, .0]],
Expand Down

0 comments on commit bb5ccef

Please sign in to comment.