ivy
ivy copied to clipboard
Paddle glu
closes #16299
Hi @MuhammadSaeedBatikh I mistakenly closed the PR(https://github.com/unifyai/ivy/pull/17198) you commented on, could pls review the changes suggested
hi @juliagsy, the failed test are unrelated and for context pls see https://github.com/unifyai/ivy/pull/17198
Hi @Adeola23, the .filter(lambda x: x[-1] % 2 == 0)
seems to do the trick! However, you only seem to be testing for the last dimension (i.e. axis = -1).
@MuhammadSaeedBatikh I'm stuck on how to test for axis I'm either getting ValueError: Expected value range of axis is [-1, 1], but received axis: 1
or hypothesis error
@MuhammadSaeedBatikh I'm stuck on how to test for axis I'm either getting
ValueError: Expected value range of axis is [-1, 1], but received axis: 1
or hypothesis error
Hi @Adeola23, putting aside this issue for now; the tests are not running properly:
E TypeError: _get_input_and_new_shape() missing 1 required positional argument: 'draw'
You need to add @st.composite
decorator to _get_input_and_new_shape
function.
Once added, your tests should run properly:
I got the following, different exception:
> return op(x)
E RuntimeError: (NotFound) The kernel with key (CPU, NCHW, int8) of kernel `sigmoid` is not registered.
E [Hint: Expected kernel_iter == iter->second.end() && kernel_key.backend() == Backend::CPU != true, but received kernel_iter == iter->second.end() && kernel_key.backend() == Backend::CPU:1 == true:1.] (at /paddle/paddle/phi/core/kernel_factory.cc:147)
E
E Falsifying example: test_paddle_glu(
E input_x_shape=(['int8'], [array([[0, 0],
E [0, 0]], dtype=int8)]),
E fn_tree='ivy.functional.frontends.paddle.nn.functional.glu',
E test_flags=FrontendFunctionTestFlags(
E num_positional_args=0,
E with_out=True,
E inplace=False,
E as_variable=[False],
E native_arrays=[False],
E generate_frontend_arrays=False,
E ),
E on_device='cpu',
E frontend='paddle',
E )
E
@MuhammadSaeedBatikh I'm stuck on how to test for axis I'm either getting
ValueError: Expected value range of axis is [-1, 1], but received axis: 1
or hypothesis errorHi @Adeola23, putting aside this issue for now; the tests are not running properly:
E TypeError: _get_input_and_new_shape() missing 1 required positional argument: 'draw'
You need to add@st.composite
decorator to_get_input_and_new_shape
function. Once added, your tests should run properly: I got the following, different exception:> return op(x) E RuntimeError: (NotFound) The kernel with key (CPU, NCHW, int8) of kernel `sigmoid` is not registered. E [Hint: Expected kernel_iter == iter->second.end() && kernel_key.backend() == Backend::CPU != true, but received kernel_iter == iter->second.end() && kernel_key.backend() == Backend::CPU:1 == true:1.] (at /paddle/paddle/phi/core/kernel_factory.cc:147) E E Falsifying example: test_paddle_glu( E input_x_shape=(['int8'], [array([[0, 0], E [0, 0]], dtype=int8)]), E fn_tree='ivy.functional.frontends.paddle.nn.functional.glu', E test_flags=FrontendFunctionTestFlags( E num_positional_args=0, E with_out=True, E inplace=False, E as_variable=[False], E native_arrays=[False], E generate_frontend_arrays=False, E ), E on_device='cpu', E frontend='paddle', E ) E
Hi @MuhammadSaeedBatikh, I just checked the latest commit and @st.composite
decorator is present and the test are running fine unless I test for other axis. Pls check the file changed
@MuhammadSaeedBatikh I'm stuck on how to test for axis I'm either getting
ValueError: Expected value range of axis is [-1, 1], but received axis: 1
or hypothesis errorHi @Adeola23, putting aside this issue for now; the tests are not running properly:
E TypeError: _get_input_and_new_shape() missing 1 required positional argument: 'draw'
You need to add@st.composite
decorator to_get_input_and_new_shape
function. Once added, your tests should run properly: I got the following, different exception:> return op(x) E RuntimeError: (NotFound) The kernel with key (CPU, NCHW, int8) of kernel `sigmoid` is not registered. E [Hint: Expected kernel_iter == iter->second.end() && kernel_key.backend() == Backend::CPU != true, but received kernel_iter == iter->second.end() && kernel_key.backend() == Backend::CPU:1 == true:1.] (at /paddle/paddle/phi/core/kernel_factory.cc:147) E E Falsifying example: test_paddle_glu( E input_x_shape=(['int8'], [array([[0, 0], E [0, 0]], dtype=int8)]), E fn_tree='ivy.functional.frontends.paddle.nn.functional.glu', E test_flags=FrontendFunctionTestFlags( E num_positional_args=0, E with_out=True, E inplace=False, E as_variable=[False], E native_arrays=[False], E generate_frontend_arrays=False, E ), E on_device='cpu', E frontend='paddle', E ) E
Hi @MuhammadSaeedBatikh, I just checked the latest commit and
@st.composite
decorator is present and the test are running fine unless I test for other axis. Pls check the file changed
You're right. Do you get the same error I posted here?
@MuhammadSaeedBatikh I'm stuck on how to test for axis I'm either getting
ValueError: Expected value range of axis is [-1, 1], but received axis: 1
or hypothesis errorHi @Adeola23, putting aside this issue for now; the tests are not running properly:
E TypeError: _get_input_and_new_shape() missing 1 required positional argument: 'draw'
You need to add@st.composite
decorator to_get_input_and_new_shape
function. Once added, your tests should run properly: I got the following, different exception:> return op(x) E RuntimeError: (NotFound) The kernel with key (CPU, NCHW, int8) of kernel `sigmoid` is not registered. E [Hint: Expected kernel_iter == iter->second.end() && kernel_key.backend() == Backend::CPU != true, but received kernel_iter == iter->second.end() && kernel_key.backend() == Backend::CPU:1 == true:1.] (at /paddle/paddle/phi/core/kernel_factory.cc:147) E E Falsifying example: test_paddle_glu( E input_x_shape=(['int8'], [array([[0, 0], E [0, 0]], dtype=int8)]), E fn_tree='ivy.functional.frontends.paddle.nn.functional.glu', E test_flags=FrontendFunctionTestFlags( E num_positional_args=0, E with_out=True, E inplace=False, E as_variable=[False], E native_arrays=[False], E generate_frontend_arrays=False, E ), E on_device='cpu', E frontend='paddle', E ) E
Hi @MuhammadSaeedBatikh, I just checked the latest commit and
@st.composite
decorator is present and the test are running fine unless I test for other axis. Pls check the file changedYou're right. Do you get the same error I posted here?
Hi @MuhammadSaeedBatikh, I don't get the same error.
Hi @Adeola23, the
.filter(lambda x: x[-1] % 2 == 0)
seems to do the trick! However, you only seem to be testing for the last dimension (i.e. axis = -1).
HI @MuhammadSaeedBatik, did you get the same error when you tested here?
@MuhammadSaeedBatikh
Hi @Adeola23 , are you still working on this function?