Ejemplo n.º 1
0
 def create_and_check_model(self, config, pixel_values, labels):
     model = ConvNextModel(config=config)
     model.to(torch_device)
     model.eval()
     result = model(pixel_values)
     # expected last hidden states: B, C, H // 32, W // 32
     self.parent.assertEqual(
         result.last_hidden_state.shape,
         (self.batch_size, self.hidden_sizes[-1], self.image_size // 32, self.image_size // 32),
     )
Ejemplo n.º 2
0
 def test_model_from_pretrained(self):
     for model_name in CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
         model = ConvNextModel.from_pretrained(model_name)
         self.assertIsNotNone(model)