def test_training(self):
        """
        Tests that all VQA models can be trained on a single batch
        """
        for model_class in self.all_model_classes:
            model = model_class(self.model_tester.get_config()).to(torch_device)
            model.train()
            loss = model(**self.model_tester.prepare_config_and_inputs_for_common()[1]).loss
            loss.backward()

            # verify the gradients are not None
            for name, param in model.named_parameters():
                self.assertIsNotNone(param.grad, f"Gradients should not be None - got {param.grad} for {name}")

        Tests that all VQA models can be trained on a single batch
        
dpkd/transformers/tests/models/blip/test_modeling_blip.py