From 8c8fd6d778a323208a0b4297d8dc108734af95ae Mon Sep 17 00:00:00 2001 From: Ishtiaq Hussain <53497039+Ishticode@users.noreply.github.com> Date: Sat, 17 Feb 2024 16:48:45 +0000 Subject: [PATCH] refactor: remove copy of dims_and_offset helper and make the call from helpers in test_jax_diagonal --- .../test_jax/test_numpy/test_indexing.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_indexing.py b/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_indexing.py index 4d76bfcc9a139..5065fbd54c3a5 100644 --- a/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_indexing.py +++ b/ivy_tests/test_ivy/test_frontends/test_jax/test_numpy/test_indexing.py @@ -53,18 +53,6 @@ def _get_dtype_square_x(draw): return dtype_x -# diagonal -@st.composite -def dims_and_offset(draw, shape): - shape_actual = draw(shape) - dim1 = draw(helpers.get_axis(shape=shape, force_int=True)) - dim2 = draw(helpers.get_axis(shape=shape, force_int=True)) - offset = draw( - st.integers(min_value=-shape_actual[dim1], max_value=shape_actual[dim1]) - ) - return dim1, dim2, offset - - # unravel_index @st.composite def max_value_as_shape_prod(draw): @@ -217,7 +205,7 @@ def test_jax_diag_indices_from( available_dtypes=helpers.get_dtypes("float"), shape=st.shared(helpers.get_shape(min_num_dims=2), key="shape"), ), - dims_and_offset=dims_and_offset( + dims_and_offset=helpers.dims_and_offset( shape=st.shared(helpers.get_shape(min_num_dims=2), key="shape") ), )