File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,9 +26,9 @@ def backward(
2626 ``.jac`` fields of the ``inputs``.
2727
2828 :param tensors: The tensor or tensors to differentiate. Should be non-empty.
29- :param jac_tensors: The initial Jacobians to backpropagate, analog to the `grad_tensors`
30- parameter of `torch.autograd.backward`. If provided, it must have the same structure as
31- ``tensors`` and each tensor in ``jac_tensors`` must match the shape of the corresponding
29+ :param jac_tensors: The initial Jacobians to backpropagate, analog to the `` grad_tensors` `
30+ parameter of :func: `torch.autograd.backward`. If provided, it must have the same structure
31+ as ``tensors`` and each tensor in ``jac_tensors`` must match the shape of the corresponding
3232 tensor in ``tensors``, with an extra leading dimension representing the number of rows of
3333 the resulting Jacobian (e.g. the number of losses). All tensors in ``jac_tensors`` must
3434 have the same first dimension. If ``None``, defaults to the identity matrix. In this case,
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ def jac(
3535 their ``requires_grad`` flag set to ``True``. If not provided, defaults to the leaf tensors
3636 that were used to compute the ``outputs`` parameter.
3737 :param jac_outputs: The initial Jacobians to backpropagate, analog to the ``grad_outputs``
38- parameter of `` torch.autograd.grad` `. If provided, it must have the same structure as
38+ parameter of :func:` torch.autograd.grad`. If provided, it must have the same structure as
3939 ``outputs`` and each tensor in ``jac_outputs`` must match the shape of the corresponding
4040 tensor in ``outputs``, with an extra leading dimension representing the number of rows of
4141 the resulting Jacobian (e.g. the number of losses). If ``None``, defaults to the identity
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ def mtl_backward(
5050 :param features: The last shared representation used for all tasks, as given by the feature
5151 extractor. Should be non-empty.
5252 :param grad_tensors: The initial gradients to backpropagate, analog to the ``grad_tensors``
53- parameter of `` torch.autograd.backward` `. If any of the ``tensors`` is non-scalar,
53+ parameter of :func:` torch.autograd.backward`. If any of the ``tensors`` is non-scalar,
5454 ``grad_tensors`` must be provided, with the same length and shapes as ``tensors``.
5555 Otherwise, this parameter is not needed and will default to scalars of 1.
5656 :param tasks_params: The parameters of each task-specific head. Their ``requires_grad`` flags
You can’t perform that action at this time.
0 commit comments