Refactor test indent

pull/146/head
Ross Wightman 4 years ago
parent 9cc289f18c
commit 5bd1ad13e7

@ -8,12 +8,12 @@ from timm import list_models, create_model
@pytest.mark.parametrize('model_name', list_models(exclude_filters='*efficientnet_l2*')) @pytest.mark.parametrize('model_name', list_models(exclude_filters='*efficientnet_l2*'))
@pytest.mark.parametrize('batch_size', [1]) @pytest.mark.parametrize('batch_size', [1])
def test_model_forward(model_name, batch_size): def test_model_forward(model_name, batch_size):
"""Run a single forward pass with each model""" """Run a single forward pass with each model"""
model = create_model(model_name, pretrained=False) model = create_model(model_name, pretrained=False)
model.eval() model.eval()
inputs = torch.randn((batch_size, *model.default_cfg['input_size'])) inputs = torch.randn((batch_size, *model.default_cfg['input_size']))
outputs = model(inputs) outputs = model(inputs)
assert outputs.shape[0] == batch_size assert outputs.shape[0] == batch_size
assert not torch.isnan(outputs).any(), 'Output included NaNs' assert not torch.isnan(outputs).any(), 'Output included NaNs'

Loading…
Cancel
Save