Skip to content

Commit 6c3dd75

Browse files
committed
* Remove check that is impossible to fail in _extract_sub_matrices
1 parent 45c068a commit 6c3dd75

File tree

1 file changed

+0
-7
lines changed
  • src/torchjd/autojac/_transform

1 file changed

+0
-7
lines changed

src/torchjd/autojac/_transform/jac.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,6 @@ def _get_jac_matrix_chunk(
116116

117117
def _extract_sub_matrices(matrix: Tensor, lengths: Sequence[int]) -> list[Tensor]:
118118
cumulative_lengths = [*accumulate(lengths)]
119-
120-
if cumulative_lengths[-1] != matrix.shape[1]:
121-
raise ValueError(
122-
"The sum of the provided lengths should be equal to the number of columns in the "
123-
"provided matrix."
124-
)
125-
126119
start_indices = [0] + cumulative_lengths[:-1]
127120
end_indices = cumulative_lengths
128121
return [matrix[:, start:end] for start, end in zip(start_indices, end_indices)]

0 commit comments

Comments
 (0)