ivy icon indicating copy to clipboard operation
ivy copied to clipboard

Paddle glu

Open Adeola23 opened this issue 1 year ago • 4 comments

closes #16299

Adeola23 avatar Jun 22 '23 10:06 Adeola23

Hi @MuhammadSaeedBatikh I mistakenly closed the PR(https://github.com/unifyai/ivy/pull/17198) you commented on, could pls review the changes suggested

Adeola23 avatar Jun 22 '23 10:06 Adeola23

hi @juliagsy, the failed test are unrelated and for context pls see https://github.com/unifyai/ivy/pull/17198

Adeola23 avatar Jun 22 '23 13:06 Adeola23

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 avatar Jun 22 '23 14:06 MuhammadSaeedBatikh

@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

Adeola23 avatar Jun 22 '23 16:06 Adeola23

@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 avatar Jun 25 '23 16:06 MuhammadSaeedBatikh

@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           

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

Adeola23 avatar Jun 25 '23 16:06 Adeola23

@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           

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 avatar Jun 26 '23 10:06 MuhammadSaeedBatikh

@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           

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?

Hi @MuhammadSaeedBatikh, I don't get the same error.

Adeola23 avatar Jun 26 '23 11:06 Adeola23

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?

Adeola23 avatar Jun 26 '23 11:06 Adeola23

@MuhammadSaeedBatikh

Adeola23 avatar Jun 27 '23 20:06 Adeola23

Hi @Adeola23 , are you still working on this function?

MahmoudAshraf97 avatar Aug 15 '23 22:08 MahmoudAshraf97