Skip tests properly (#31308)
* Skip tests properly * [test_all] * Add 'reason' as kwarg for skipTest * [test_all] Fix up * [test_all]
This commit is contained in:
@@ -335,14 +335,15 @@ class BigBirdPegasusModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineT
|
||||
|
||||
def test_generate_without_input_ids(self):
|
||||
if self.model_tester.attention_type == "block_sparse":
|
||||
# this test can never pass for BigBird-block-sparse attention since input_ids must be multiple of block_size
|
||||
return
|
||||
self.skipTest(
|
||||
"Cannot pass for BigBird-block-sparse attention since input_ids must be multiple of block_size"
|
||||
)
|
||||
super().test_generate_without_input_ids()
|
||||
|
||||
def test_retain_grad_hidden_states_attentions(self):
|
||||
if self.model_tester.attention_type == "block_sparse":
|
||||
# this test can't pass since attention matrix (which is getting returned) can't have gradients (& just 0 at many locations)
|
||||
return
|
||||
self.skipTest(reason="Cannot pass since returned attention matrix can't have gradients")
|
||||
super().test_retain_grad_hidden_states_attentions()
|
||||
|
||||
# BigBirdPegasusForSequenceClassification does not support inputs_embeds
|
||||
@@ -811,6 +812,6 @@ class BigBirdPegasusStandaloneDecoderModelTest(ModelTesterMixin, GenerationTeste
|
||||
config_and_inputs = self.model_tester.prepare_config_and_inputs()
|
||||
self.model_tester.create_and_check_decoder_model_attention_mask_past(*config_and_inputs)
|
||||
|
||||
@unittest.skip("Decoder cannot retain gradients")
|
||||
def test_retain_grad_hidden_states_attentions(self):
|
||||
# decoder cannot keep gradients
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user