Skip to content

Commit

Permalink
fix: bug in tf backend get_item when converting tuples to slices with…
Browse files Browse the repository at this point in the history
…in query
  • Loading branch information
Sam-Armstrong committed Sep 18, 2024
1 parent 38ebcca commit 7341a40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ivy/functional/backends/tensorflow/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_item(
query = tf.cast(query, tf.int64)
return tf.gather(x, query, axis=0)
else:
if any([isinstance(q, slice) for q in query]):
if isinstance(query, (list, tuple)) and any([isinstance(q, (list, tuple)) for q in query]):
# convert any lists/tuples within the query to slices
query = tuple(
[slice(*q) if isinstance(q, (list, tuple)) else q for q in query]
Expand Down

0 comments on commit 7341a40

Please sign in to comment.