# tf.linalg.eigvalsh

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.10.1/tensorflow/python/ops/linalg_ops.py#L461-L482) |

Computes the eigenvalues of one or more self-adjoint matrices.

#### View aliases


**Compat aliases for migration**

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

[`tf.compat.v1.linalg.eigvalsh`](https://www.tensorflow.org/api_docs/python/tf/linalg/eigvalsh), [`tf.compat.v1.self_adjoint_eigvals`](https://www.tensorflow.org/api_docs/python/tf/linalg/eigvalsh)

<br />

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

> [!NOTE]
> **Note:** If your program backpropagates through this function, you should replace it with a call to tf.linalg.eigh (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 />