Skip to content

Commit 712667c

Browse files
committed
Delete jac field instead of setting to None
1 parent 99b4260 commit 712667c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/torchjd/utils/_jac_to_grad.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ def _disunite_gradient(
6666

6767
def _free_jacs(params: Iterable[Tensor]) -> None:
6868
"""
69-
Clears the ``.jac`` fields of the provided parameters by setting them to ``None``.
69+
Deletes the ``.jac`` field of the provided parameters.
7070
7171
:param params: The parameters whose ``.jac`` fields should be cleared.
7272
"""
7373

7474
for p in params:
75-
p.jac = None
75+
del p.jac

0 commit comments

Comments
 (0)