<!--
This file is generated by a tool. Do not edit directly.
For open-source contributions the docs will be updated automatically.
-->

*Last updated: 2023-03-16.*

<div itemscope itemtype="http://developers.google.com/ReferenceObject">
<meta itemprop="name" content="tf_quant_finance.math.jacobian" />
<meta itemprop="path" content="Stable" />
</div>

# tf_quant_finance.math.jacobian

<!-- Insert buttons and diff -->

<table class="tfo-notebook-buttons tfo-api" align="left">
</table>

<a target="_blank" href="https://github.com/paolodelia99/tf-quant-finance/blob/main/tf_quant_finance/math/jacobian.py">View source</a>



Computes the jacobian of `func` wrt to `x`.

```python
tf_quant_finance.math.jacobian(
    func, x, unconnected_gradients=None, parallel_iterations=None,
    experimental_use_pfor=True, name=None
)
```



<!-- Placeholder for "Used in" -->


#### Args:


* <b>`func`</b>: Python callable accepting one `Tensor` of shape of `x` and returning
  a `Tensor` of any shape. The function whose jacobian is to be computed.
* <b>`x`</b>: A `Tensor` with respect to which the gradient is to be computed.
* <b>`unconnected_gradients`</b>: An enum `tf.UnconnectedGradients` which specifies
  the gradient value returned when the given input tensors are
  unconnected. Default value: `None`, which maps to
  `tf.UnconnectedGradients.NONE`.
* <b>`parallel_iterations`</b>: A knob to control how many iterations are dispatched
  in parallel. This knob can be used to control the total memory usage.
* <b>`experimental_use_pfor`</b>: If true, uses pfor for computing the Jacobian.
  Else uses a tf.while_loop.
* <b>`name`</b>: Python `str` name prefixed to ops created by this function.
  Default value: `None` (i.e., 'jacobian').


#### Returns:

A `Tensor` with the gradient of `y` wrt each of `x`.
