Skip to content

Commit 0ab32c0

Browse files
committed
* Remove check that is impossible to fail in _differentiate
1 parent a2e77c7 commit 0ab32c0

File tree

1 file changed

+1
-8
lines changed
  • src/torchjd/autojac/_transform

1 file changed

+1
-8
lines changed

src/torchjd/autojac/_transform/jac.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,7 @@ def _differentiate(self, jac_outputs: Sequence[Tensor]) -> tuple[Tensor, ...]:
4343
if len(inputs) == 0:
4444
return tuple()
4545

46-
n_outputs = len(outputs)
47-
if len(jac_outputs) != n_outputs:
48-
raise ValueError(
49-
"Parameters `outputs` and `jac_outputs` should be sequences of the same length."
50-
f"Found `len(outputs) = {n_outputs}` and `len(jac_outputs) = {len(jac_outputs)}`."
51-
)
52-
53-
if n_outputs == 0:
46+
if len(outputs) == 0:
5447
return tuple(
5548
[
5649
torch.empty((0,) + input.shape, device=input.device, dtype=input.dtype)

0 commit comments

Comments
 (0)