# tf.raw_ops.TridiagonalSolve

<br />

Solves tridiagonal systems of equations.

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.raw_ops.TridiagonalSolve(
        diagonals, rhs, partial_pivoting=True, perturb_singular=False, name=None
    )

Solves tridiagonal systems of equations.
Supports batch dimensions and multiple right-hand sides per each left-hand
side.
On CPU, solution is computed via Gaussian elimination with or without partial
pivoting, depending on `partial_pivoting` attribute. On GPU, Nvidia's cuSPARSE
library is used: <https://docs.nvidia.com/cuda/cusparse/index.html#gtsv>
Partial pivoting is not yet supported by XLA backends.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `diagonals` | A `Tensor`. Must be one of the following types: `float64`, `float32`, `complex64`, `complex128`. Tensor of shape `[..., 3, M]` whose innermost 2 dimensions represent the tridiagonal matrices with three rows being the superdiagonal, diagonals, and subdiagonals, in order. The last element of the superdiagonal and the first element of the subdiagonal is ignored. |
| `rhs` | A `Tensor`. Must have the same type as `diagonals`. Tensor of shape `[..., M, K]`, representing K right-hand sides per each left-hand side. |
| `partial_pivoting` | An optional `bool`. Defaults to `True`. Whether to apply partial pivoting. Partial pivoting makes the procedure more stable, but slower. |
| `perturb_singular` | An optional `bool`. Defaults to `False`. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor`. Has the same type as `diagonals`. ||

<br />