We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c8a3cb commit 056b7e0Copy full SHA for 056b7e0
2 files changed
src/torchjd/autojac/_jac.py
@@ -68,8 +68,8 @@ def jac(
68
>>> jacobians = jac([y1, y2], param)
69
>>>
70
>>> jacobians
71
- (tensor([[-1., 1.],
72
- [ 2., 4.]]),)
+ (tensor([[-1., 1.],
+ [ 2., 4.]]),)
73
74
.. admonition::
75
Example
src/torchjd/autojac/_jac_to_grad.py
@@ -105,7 +105,7 @@ def jac_to_grad(
105
>>> param.grad
106
tensor([0.5000, 2.5000])
107
>>> weights
108
- tensor([0.5, 0.5])
+ tensor([0.5000, 0.5000])
109
110
The ``.grad`` field of ``param`` now contains the aggregation (by UPGrad) of the Jacobian of
111
:math:`\begin{bmatrix}y_1 \\ y_2\end{bmatrix}` with respect to ``param``. In this case, the
0 commit comments