# tf.raw_ops.Eig

<br />

Computes the eigen decomposition of one or more square matrices.

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.raw_ops.Eig(
        input, Tout, compute_v=True, name=None
    )

Computes the eigenvalues and (optionally) right eigenvectors of each inner matrix in
`input` such that `input[..., :, :] = v[..., :, :] * diag(e[..., :])`. The eigenvalues
are sorted in non-decreasing order.

    # a is a tensor.
    # e is a tensor of eigenvalues.
    # v is a tensor of eigenvectors.
    e, v = eig(a)
    e = eig(a, compute_v=False)

<br />

<br />

<br />

| ## Args ||
|---|---|
| `input` | A `Tensor`. Must be one of the following types: `float32`, `float64`, `complex64`, `complex128`. `Tensor` input of shape `[N, N]`. |
| `Tout` | A [`tf.DType`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/dtypes/DType) from: `tf.complex64, tf.complex128`. |
| `compute_v` | An optional `bool`. Defaults to `True`. If `True` then eigenvectors will be computed and returned in `v`. Otherwise, only the eigenvalues will be computed. |
| `name` | A name for the operation (optional). |

<br />

<br />

| ## Returns ||
|---|---|
| A tuple of `Tensor` objects (e, v). ||
| `e` | A `Tensor` of type `Tout`. |
| `v` | A `Tensor` of type `Tout`. |

<br />