From 1e912c016e6cc2d3c07d48b098c53444676dbeaa Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Thu, 11 Jul 2024 22:25:45 +0200 Subject: [PATCH] Simplify return_inverse fixup --- python/cuml/tests/test_make_classification.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/python/cuml/tests/test_make_classification.py b/python/cuml/tests/test_make_classification.py index 9daee2de25..e8b0b7a088 100644 --- a/python/cuml/tests/test_make_classification.py +++ b/python/cuml/tests/test_make_classification.py @@ -115,11 +115,8 @@ def test_make_classification_informative_features(): # Cluster by sign, viewed as strings to allow uniquing signs = np.sign(cp.asnumpy(X)) - signs = signs.view(dtype="|S{0}".format(signs.strides[0])) + signs = signs.view(dtype="|S{0}".format(signs.strides[0])).ravel() unique_signs, cluster_index = np.unique(signs, return_inverse=True) - # NumPy 2 has a behavior change (maybe regression) for the inverse shape - # https://github.com/numpy/numpy/issues/26738. This always works: - cluster_index = cluster_index.reshape(-1) assert ( len(unique_signs) == n_clusters