def test_resnext(): x = torch.randn(1, 3, 32, 32) # ResNeXt-29, 8×64d net = ResNeXt(stages=(64, 256, 512, 1024), depth=29, groups=8, base_width=64) assert profile(net, (x, ))[1] == 34426634 # ResNeXt-29, 16×64d net = ResNeXt(stages=(64, 256, 512, 1024), depth=29, groups=16, base_width=64) assert profile(net, (x, ))[1] == 68155146
def test_regnet(): x = torch.randn(1, 3, 32, 32) net = RegNet(32, (96, 256, 640), [4, 8, 2], 16, use_se=True) assert profile(net, (x, ))[1] == 3920266