<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/linalg.py#L487-L503) |

Solves a linear system of equations given by `a x = b`.

#### View aliases


**Main aliases**

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

<br />

    tf.keras.ops.solve(
        a, b
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `a` | A tensor of shape `(..., M, M)` representing the coefficients matrix. |
| `b` | A tensor of shape `(..., M)` or `(..., M, N)` representing the right-hand side or "dependent variable" matrix. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tensor of shape `(..., M)` or `(..., M, N)` representing the solution of the linear system. Returned shape is identical to `b`. ||

<br />