Apply TorchFix TOR203 fixes (#143691)

Codemodded via `torchfix . --select=TOR203 --fix`.
This is a step to unblock https://github.com/pytorch/pytorch/pull/141076
Pull Request resolved: https://github.com/pytorch/pytorch/pull/143691
Approved by: https://github.com/malfet
This commit is contained in:
Sergii Dymchenko
2024-12-23 18:21:03 +00:00
committed by PyTorch MergeBot
parent c042c8a475
commit 727ee853b4
6 changed files with 6 additions and 8 deletions

View File

@ -4541,7 +4541,7 @@ class TestExamplesCorrectness(TestCase):
@unittest.skipIf(not USE_TORCHVISION, "test requires torchvision")
@parametrize("mechanism", ["make_functional", "functional_call"])
def test_resnet18_per_sample_grads(self, device, mechanism):
import torchvision.models as models
from torchvision import models
model = models.__dict__["resnet18"](
pretrained=False, norm_layer=(lambda c: nn.GroupNorm(min(32, c), c))