Skip to content

Commit

Permalink
update ruff rules
Browse files Browse the repository at this point in the history
  • Loading branch information
narumiruna committed Jun 21, 2024
1 parent bbbe5b1 commit c8ea8b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ exclude = ["build"]
line-length = 120

[tool.ruff.lint]
ignore = [
"N812", # lowercase-imported-as-non-lowercase
]
select = [
"B", # flake8-bugbear
"C", # flake8-comprehensions
Expand Down
6 changes: 3 additions & 3 deletions template/trainers/mnist.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import torch
import torch.nn.functional as F
import torch.nn.functional as f
import wandb
from mlconfig import register
from torch.nn import Module
Expand Down Expand Up @@ -72,7 +72,7 @@ def train(self) -> None:
y = y.to(self.device)

output = self.model(x)
loss = F.cross_entropy(output, y)
loss = f.cross_entropy(output, y)

self.optimizer.zero_grad()
loss.backward()
Expand All @@ -95,7 +95,7 @@ def evaluate(self) -> None:
y = y.to(self.device)

output = self.model(x)
loss = F.cross_entropy(output, y)
loss = f.cross_entropy(output, y)

loss_metric.update(loss, weight=x.size(0))
acc_metric.update(output, y)
Expand Down

0 comments on commit c8ea8b2

Please sign in to comment.