# tf.linalg.eigvals

<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/linalg_ops.py#L410-L434) |

Computes the eigenvalues of one or more matrices.

#### View aliases


**Main aliases**

[`tf.eigvals`](https://www.tensorflow.org/api_docs/python/tf/linalg/eigvals)

<br />

    tf.linalg.eigvals(
        tensor, name=None
    )

> [!NOTE]
> **Note:** If your program backpropagates through this function, you should replace it with a call to tf.linalg.eig (possibly ignoring the second output) to avoid computing the eigen decomposition twice. This is because the eigenvectors are used to compute the gradient w.r.t. the eigenvalues. See _SelfAdjointEigV2Grad in linalg_grad.py.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `tensor` | `Tensor` of shape `[..., N, N]`. |
| `name` | string, optional name of the operation. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| `e` | Eigenvalues. Shape is `[..., N]`. The vector `e[..., :]` contains the `N` eigenvalues of `tensor[..., :, :]`. |

<br />