Skip to content

Commit e907573

Browse files
authored
refactor(aggregation): Rename GradDrop matrix shape check (#803)
1 parent 04622a7 commit e907573

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/torchjd/aggregation/_graddrop.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def __init__(self, f: Callable = _identity, leak: Tensor | None = None) -> None:
3434
self.leak = leak
3535

3636
def forward(self, matrix: Matrix, /) -> Tensor:
37-
self._check_matrix_has_enough_rows(matrix)
37+
self._check_matrix_shape(matrix)
3838

3939
if matrix.shape[0] == 0 or matrix.shape[1] == 0:
4040
return torch.zeros(matrix.shape[1], dtype=matrix.dtype, device=matrix.device)
@@ -65,7 +65,7 @@ def leak(self, value: Tensor | None) -> None:
6565

6666
self._leak = value
6767

68-
def _check_matrix_has_enough_rows(self, matrix: Tensor) -> None:
68+
def _check_matrix_shape(self, matrix: Tensor) -> None:
6969
n_rows = matrix.shape[0]
7070
if self.leak is not None and n_rows != len(self.leak):
7171
raise ValueError(

0 commit comments

Comments
 (0)