# tf.contrib.distributions.tridiag

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/distributions/util.py#L981-L1046) |

Creates a matrix with values set above, below, and on the diagonal.

    tf.contrib.distributions.tridiag(
        below=None, diag=None, above=None, name=None
    )

#### Example:

    tridiag(below=[1., 2., 3.],
            diag=[4., 5., 6., 7.],
            above=[8., 9., 10.])
    # ==> array([[  4.,   8.,   0.,   0.],
    #            [  1.,   5.,   9.,   0.],
    #            [  0.,   2.,   6.,  10.],
    #            [  0.,   0.,   3.,   7.]], dtype=float32)

> [!WARNING]
> **Warning:** This Op is intended for convenience, not efficiency.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `below` | `Tensor` of shape `[B1, ..., Bb, d-1]` corresponding to the below diagonal part. `None` is logically equivalent to `below = 0`. |
| `diag` | `Tensor` of shape `[B1, ..., Bb, d]` corresponding to the diagonal part. `None` is logically equivalent to `diag = 0`. |
| `above` | `Tensor` of shape `[B1, ..., Bb, d-1]` corresponding to the above diagonal part. `None` is logically equivalent to `above = 0`. |
| `name` | Python `str`. The name to give this op. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| `tridiag` | `Tensor` with values set above, below and on the diagonal. |

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | if all inputs are `None`. |

<br />