def test_model_nohparams_train_test(tmp_path, cls):
    """Test models that do not take any argument in init."""
    model = cls()
    trainer = Trainer(max_epochs=1, default_root_dir=tmp_path)

    train_loader = DataLoader(RandomDataset(32, 64), batch_size=32)
    trainer.fit(model, train_loader)

    test_loader = DataLoader(RandomDataset(32, 64), batch_size=32)
    trainer.test(dataloaders=test_loader)
Test models that do not take any argument in init.
tests/tests_pytorch/models/test_hparams.py