MCPcopy
hub / github.com/alibaba/EasyCV / test_resnest_withfc

Method test_resnest_withfc

tests/test_models/backbones/test_resnest.py:24–32  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

22 self.assertEqual(output[0].shape, torch.Size([batch_size, 2048, 7, 7]))
23
24 def test_resnest_withfc(self):
25 batch_size = 2
26 num_classes = 5
27 images = torch.rand(batch_size, 3, 224, 224).to('cuda')
28 model = ResNeSt(101, num_classes=num_classes).to('cuda')
29 model.init_weights()
30 output = model(images)
31 self.assertEqual(output[0].shape, torch.Size([batch_size,
32 num_classes]))
33
34 def test_resnest_jit(self):
35 with torch.no_grad():

Callers

nothing calls this directly

Calls 3

ResNeStClass · 0.90
toMethod · 0.45
init_weightsMethod · 0.45

Tested by

no test coverage detected