diff --git a/ivy/functional/backends/tensorflow/general.py b/ivy/functional/backends/tensorflow/general.py index 02d69cbd16a4..7f3d5610cc57 100644 --- a/ivy/functional/backends/tensorflow/general.py +++ b/ivy/functional/backends/tensorflow/general.py @@ -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]