<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#L872-L914) |

Computes a (forward-mode) Jacobian-vector product of `fun`.

#### View aliases


**Main aliases**

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

<br />

    tf.keras.ops.jvp(
        fun, primals, tangents, has_aux=False
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `fun` | Function to be differentiated. Its arguments should be arrays, scalars, or standard Python containers of arrays or scalars. It should return an array, scalar, or standard Python container of arrays or scalars. |
| `primals` | The primal values at which the Jacobian of `fun` should be evaluated. Should be either a tuple or a list of arguments, and its length should be equal to the number of positional parameters of `fun`. |
| `tangents` | The tangent vector for which the Jacobian-vector product should be evaluated. Should be either a tuple or a list of tangents, with the same tree structure and array shapes as `primals`. |
| `has_aux` | Optional, bool. Indicates whether `fun` returns a pair where the first element is considered the output of the mathematical function to be differentiated and the second element is auxiliary data. Default is False. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| If `has_aux` is False, returns a (`primals_out`, `tangents_out`) pair, where `primals_out` is `fun(*primals)`, and `tangents_out` is the Jacobian-vector product of `fun` evaluated at `primals` with `tangents`. The `tangents_out` value has the same Python tree structure and shapes as `primals_out`. <br /> If `has_aux` is True, returns a (`primals_out`, `tangents_out`, `aux`) tuple where `aux` is the auxiliary data returned by `fun`. ||

<br />

#### Example:

    from keras import ops
    a1, a2 = ops.convert_to_tensor(0.1), ops.convert_to_tensor(0.2)
    primals, tangents = ops.jvp(ops.sin, (a1,), (a2,))
    primals
    0.09983342
    tangents
    0.19900084