Skip to content

Commit 0f1c909

Browse files
committed
Fix elif
1 parent 8862c16 commit 0f1c909

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/torchjd/autogram/_gramian_computer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def _compute_gramian(self, dY1: Tensor, dY2: Tensor, X: Tensor) -> Tensor:
111111
# TODO: not sure that this even works
112112
G_b = torch.einsum("k,k->", dY1, dY2)
113113
G_W = torch.einsum("k,l,l,k->", dY1, X, X, dY2)
114-
if dY1.ndim == 2:
114+
elif dY1.ndim == 2:
115115
G_b = torch.einsum("ak,ik->ai", dY1, dY2)
116116
G_W = torch.einsum("ak,al,il,ik->ai", dY1, X, X, dY2)
117117
elif dY1.ndim == 3: # Typical in transformers

0 commit comments

Comments
 (0)