-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Ivy Failing Test: paddle - general.get_item #28050
Comments
This issue might be related to the test suite. It is throwing import paddle
from ivy_tests.test_ivy.helpers.pipeline_helper import BackendHandler
import ivy
from ivy.functional.backends.paddle.general import get_item
backend_to_test = "paddle"
args = [ivy.array([]), ()]
kwargs = {"copy": False}
fn = get_item
with BackendHandler.update_backend(backend_to_test) as ivy_backend:
with ivy_backend.PreciseMode(False):
ret = fn(*args, **kwargs) I'm attaching the output of |
It has identified a runtime issue where the `get_item` function raises a `RuntimeError` when an empty array is passed as an input. This error occurs under the specific condition when `ivy.array([])` is used as an argument, leading to an uninitialized tensor error within the Paddle backend. This PR aims at introducing a check for empty arrays at the beginning of the `get_item` function. If the input array is empty, the function now returns an appropriately shaped and typed empty Paddle tensor, preventing the uninitialized tensor error. With this change, the `get_item` function can now safely handle empty array inputs without raising an error, ensuring consistent behavior and robustness. This fix also aligns with the expected behavior when using scalar boolean indices, where an empty tensor is returned if the boolean condition is False. This change does not affect any existing functionality or performance for non-empty array inputs. This fix is in response to the issue reported in [ivy-llc#28050] where users encountered runtime errors during testing scenarios involving empty arrays.
ToDo - #27501
Sub-Task: Priority Open
The text was updated successfully, but these errors were encountered: