Skip to content

Commit

Permalink
Improve pre-commit for mypy and black
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerYep committed Sep 9, 2023
1 parent 238e33d commit d34de25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
hooks:
- id: isort

- repo: https://github.com/psf/black
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.7.0
hooks:
- id: black
Expand Down
4 changes: 2 additions & 2 deletions tests/torchinfo_xl_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ def test_eval_order_doesnt_matter() -> None:
)
model1.eval()
summary(model1, input_size=input_size)
with torch.inference_mode(): # type: ignore[no-untyped-call]
with torch.inference_mode():
output1 = model1(input_tensor)

model2 = torchvision.models.resnet18(
weights=torchvision.models.ResNet18_Weights.DEFAULT
)
summary(model2, input_size=input_size)
model2.eval()
with torch.inference_mode(): # type: ignore[no-untyped-call]
with torch.inference_mode():
output2 = model2(input_tensor)

assert torch.all(torch.eq(output1, output2))
Expand Down

0 comments on commit d34de25

Please sign in to comment.