Skip to content

Commit

Permalink
fix (JAX backend)(general.py): adding a check to the implementation o…
Browse files Browse the repository at this point in the history
…f `set_item` to handle the case where the query is an empty list or tuple.
  • Loading branch information
YushaArif99 committed Oct 3, 2024
1 parent da1d258 commit 704f725
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ivy/functional/backends/jax/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ def set_item(
*,
copy: Optional[bool] = False,
) -> JaxArray:

if query == [] or query == ():
return x
if ivy.is_array(query) and ivy.is_bool_dtype(query):
query = _mask_to_index(query, x)
expected_shape = x[query].shape
Expand Down

0 comments on commit 704f725

Please sign in to comment.