# tf.make_ndarray

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/make_ndarray) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/framework/tensor_util.py#L562-L629) |

Create a numpy ndarray from a tensor.

#### View aliases


**Main aliases**

\`tf.contrib.util.make_ndarray\`
**Compat aliases for migration**

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

[`tf.compat.v1.make_ndarray`](https://www.tensorflow.org/api_docs/python/tf/make_ndarray), \`tf.compat.v2.make_ndarray\`

<br />

    tf.make_ndarray(
        tensor
    )

Create a numpy ndarray with the same shape and data as the tensor.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `tensor` | A TensorProto. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A numpy array with the tensor contents. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | if tensor has unsupported type. |

<br />