# tf.shape_n

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.13.1/tensorflow/python/ops/array_ops.py#L710-L737) |

Returns shape of a list of tensors.

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.shape_n(
        input,
        out_type=https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/dtypes#int32,
        name=None
    )

Given a list of tensors, [`tf.shape_n`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/shape_n) is much faster than applying [`tf.shape`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/shape)
to each tensor individually.

    >>> a = tf.ones([1, 2])
    >>> b = tf.ones([2, 3])
    >>> c = tf.ones([3, 4])
    >>> tf.shape_n([a, b, c])
    [<tf.Tensor: shape=(2,), dtype=int32, numpy=array([1, 2], dtype=int32)>,
    <tf.Tensor: shape=(2,), dtype=int32, numpy=array([2, 3], dtype=int32)>,
    <tf.Tensor: shape=(2,), dtype=int32, numpy=array([3, 4], dtype=int32)>]

<br />

<br />

<br />

| ## Args ||
|---|---|
| `input` | A list of at least 1 `Tensor` object with the same dtype. |
| `out_type` | The specified output type of the operation (`int32` or `int64`). Defaults to [`tf.int32`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf#int32)(optional). |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A list of `Tensor` specifying the shape of each input tensor with type of `out_type`. ||

<br />