# tf.nest.is_nested

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.7.4/tensorflow/python/util/nest.py#L275-L317) |

Returns true if its input is a collections.abc.Sequence (except strings).

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.nest.is_nested`](https://www.tensorflow.org/api_docs/python/tf/nest/is_nested)

<br />

    tf.nest.is_nested(
        seq
    )

<br />

      tf.nest.is_nested("1234")
        False
        
      
<br />

<br />

      tf.nest.is_nested([1, 3, [4, 5]])
        True
        
      
<br />

<br />

      tf.nest.is_nested(((7, 8), (5, 6)))
        True
        
      
<br />

<br />

      tf.nest.is_nested([])
        True
        
      
<br />

<br />

      tf.nest.is_nested({"a": 1, "b": 2})
        True
        
      
<br />

<br />

      tf.nest.is_nested({"a": 1, "b": 2}.keys())
        True
        
      
<br />

<br />

      tf.nest.is_nested({"a": 1, "b": 2}.values())
        True
        
      
<br />

<br />

      tf.nest.is_nested({"a": 1, "b": 2}.items())
        True
        
      
<br />

<br />

      tf.nest.is_nested(set([1, 2]))
        False
        
      
<br />

<br />

      ones = tf.ones([2, 3])
      tf.nest.is_nested(ones)
        False
        
      
<br />

<br />

<br />

<br />

| ## Args ||
|---|---|
| `seq` | an input sequence. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| True if the sequence is a not a string and is a collections.abc.Sequence or a dict. ||

<br />