From 0462e397701349b4593b50470a4a703de7c3f669 Mon Sep 17 00:00:00 2001 From: akshatvishu Date: Wed, 6 Sep 2023 14:41:16 +0000 Subject: [PATCH 1/2] test: skip tests for Paddle backend with dimensions >= 10 Added a condition to skip tests in "test_tensorflow_zeros" when using the Paddle backend and the dimension is 10 or more. This is a temporary measure until the Paddle backend supports dimensions greater than 9. --- .../test_tensorflow/test_general_functions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_general_functions.py b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_general_functions.py index 9e114650dcc4f..70a9930c582b8 100644 --- a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_general_functions.py +++ b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_general_functions.py @@ -2,6 +2,7 @@ from hypothesis import strategies as st, assume import numpy as np from tensorflow import errors as tf_errors +import ivy # local import ivy_tests.test_ivy.helpers as helpers @@ -2397,6 +2398,9 @@ def test_tensorflow_zeros( fn_tree, on_device, ): + if ivy.current_backend_str() == "paddle": + # Paddle only supports ndim from 0 to 9 + assume(input.shape[0] < 10) helpers.test_frontend_function( shape=input, input_dtypes=dtype, @@ -2412,7 +2416,7 @@ def test_tensorflow_zeros( @handle_frontend_test( fn_tree="tensorflow.zeros_like", dtype_and_x=helpers.dtype_and_values( - available_dtypes=helpers.get_dtypes("numeric") + available_dtypes=helpers.get_dtypes("numeric"), ), dtype=helpers.get_dtypes("numeric", full=False), test_with_out=st.just(False), From 652eefa468c9137d6cc7068788b78d9812fa037a Mon Sep 17 00:00:00 2001 From: akshatvishu Date: Wed, 4 Oct 2023 11:50:59 +0000 Subject: [PATCH 2/2] fix(test) made max_num_dims and max_dim_size for tensorflow.zeros test equal to 9 as PaddlePaddle only support till 9 dims. --- .../test_tensorflow/test_general_functions.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_general_functions.py b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_general_functions.py index 70a9930c582b8..3eadfdef80a3d 100644 --- a/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_general_functions.py +++ b/ivy_tests/test_ivy/test_frontends/test_tensorflow/test_general_functions.py @@ -2,7 +2,6 @@ from hypothesis import strategies as st, assume import numpy as np from tensorflow import errors as tf_errors -import ivy # local import ivy_tests.test_ivy.helpers as helpers @@ -2382,9 +2381,9 @@ def _test_body_fn(x): input=helpers.get_shape( allow_none=False, min_num_dims=0, - max_num_dims=10, + max_num_dims=9, min_dim_size=0, - max_dim_size=10, + max_dim_size=9, ), dtype=helpers.get_dtypes("valid", full=False), ) @@ -2398,9 +2397,6 @@ def test_tensorflow_zeros( fn_tree, on_device, ): - if ivy.current_backend_str() == "paddle": - # Paddle only supports ndim from 0 to 9 - assume(input.shape[0] < 10) helpers.test_frontend_function( shape=input, input_dtypes=dtype,