# tensorplay.func.jacfwd Source: https://www.tensorplay.cn/docs/generated/tensorplay.func.jacfwd.html ```python tensorplay.func.jacfwd(func: Callable, argnums: int | tuple[int, ...] = 0, has_aux: bool = False, *, randomness: str = 'error') ``` Returns a function computing the Jacobian of func by forward mode. Forward mode costs one pass per input element, so jacfwd is the cheaper direction when the input is smaller than the output – the mirror image of [jacrev()](/docs/generated/tensorplay.func.jacrev.html#tensorplay.func.jacrev). Parameters: - func (Callable) – a Python function returning one or more tensors. - argnums ([int](https://docs.python.org/3/builtins/functions.html#int) or Tuple[[int](https://docs.python.org/3/builtins/functions.html#int)]) – which positional arguments to differentiate with respect to. Default: 0. - has_aux ([bool](https://docs.python.org/3/builtins/functions.html#bool)) – whether func returns (output, aux). - randomness ([str](https://docs.python.org/3/builtins/stdtypes.html#str)) – how the underlying map treats random operations; one of "error", "different" or "same". Example ``` >>> jacobian = jacfwd(tensorplay.sin)(tensorplay.randn(5)) ```