Skip to content

Commit 93ebf63

Browse files
committed
Rename _i to _
1 parent 21bfe12 commit 93ebf63

5 files changed

Lines changed: 5 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ Changelog = "https://github.com/TorchJD/torchjd/blob/main/CHANGELOG.md"
6767
[dependency-groups]
6868
check = [
6969
"ruff>=0.14.14",
70-
"mypy>=1.16.0",
7170
"ty>=0.0.14",
7271
"pre-commit>=2.9.2", # isort doesn't work before 2.9.2
7372
]

src/torchjd/aggregation/_mgda.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def forward(self, gramian: PSDMatrix, /) -> Tensor:
5353
dtype = gramian.dtype
5454

5555
alpha = torch.ones(gramian.shape[0], device=device, dtype=dtype) / gramian.shape[0]
56-
for _i in range(self.max_iters):
56+
for _ in range(self.max_iters):
5757
t = torch.argmin(gramian @ alpha)
5858
e_t = torch.zeros(gramian.shape[0], device=device, dtype=dtype)
5959
e_t[t] = 1.0

tests/unit/autogram/test_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def test_iwrm_steps_with_autogram(factory: ModuleFactory, batch_size: int, batch
341341
engine = Engine(model, batch_dim=batch_dim)
342342
optimizer = SGD(model.parameters(), lr=1e-7)
343343

344-
for _i in range(n_iter):
344+
for _ in range(n_iter):
345345
inputs, targets = make_inputs_and_targets(model, batch_size)
346346
loss_fn = make_mse_loss_fn(targets)
347347
autogram_forward_backward(model, inputs, loss_fn, engine, weighting)

tests/unit/autojac/_transform/test_accumulate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_multiple_grad_accumulations(iterations: int):
3838
values = [ones_(shape) for shape in shapes]
3939
accumulate = AccumulateGrad()
4040

41-
for _i in range(iterations):
41+
for _ in range(iterations):
4242
# Clone values to ensure that we accumulate values that are not ever used afterwards
4343
input = {key: value.clone() for key, value in zip(keys, values, strict=False)}
4444
accumulate(input)
@@ -122,7 +122,7 @@ def test_multiple_jac_accumulations(iterations: int):
122122

123123
accumulate = AccumulateJac()
124124

125-
for _i in range(iterations):
125+
for _ in range(iterations):
126126
# Clone values to ensure that we accumulate values that are not ever used afterwards
127127
input = {key: value.clone() for key, value in zip(keys, values, strict=False)}
128128
accumulate(input)

tests/unit/autojac/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def test_get_leaf_tensors_deep(depth: int):
152152

153153
one = tensor_(1.0, requires_grad=True)
154154
sum_ = tensor_(0.0, requires_grad=False)
155-
for _i in range(depth):
155+
for _ in range(depth):
156156
sum_ = sum_ + one
157157

158158
leaves = get_leaf_tensors(tensors=[sum_], excluded=set())

0 commit comments

Comments
 (0)