latest (dev)
Copy
Latest development documentation · Updated 2026-10-08
tensorplay.func.jvp
- tensorplay.func.jvp(func: Callable, primals: Any, tangents: Any, *, strict: bool = False, has_aux: bool = False)
Evaluates
funcatprimalstogether with its directional derivative alongtangents.- Parameters:
func (Callable) – a Python function taking one or more tensor arguments.
primals (Tensors) – a tuple of positional arguments to evaluate at.
tangents (Tensors) – the direction to differentiate along. Must have the same python structure, shapes and dtypes as
primals.strict (bool) – raise instead of returning zeros when the output turns out to be independent of the inputs.
has_aux (bool) – whether
funcreturns(output, aux).
- Returns:
(output, jvp_out), or(output, jvp_out, aux)whenhas_aux.
Example
>>> x = tensorplay.randn(5) >>> out, tangent_out = jvp(tensorplay.sin, (x,), (tensorplay.ones(5),))
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

