code: def test_sequence_classification_model(self):
      (
          config,
          input_ids,
          _,
          attention_mask,
          *_,
      ) = self.model_tester.prepare_config_and_inputs()
      config.num_labels = self.model_tester.num_labels
      sequence_labels = ids_tensor(
          [self.model_tester.batch_size],
          self.model_tester.type_sequence_label_size,
      )
      model = MegaForSequenceClassification(config)
      model.to(torch_device)
      model.eval()
      result = model(
          input_ids,
          attention_mask=attention_mask,
          labels=sequence_labels,
      )
      self.assertEqual(
          result.logits.shape,
          (self.model_tester.batch_size, self.model_tester.num_labels),
      )
  
imports: import unittest
  from transformers import MegaConfig, is_torch_available
  from transformers.testing_utils import TestCasePlus, require_torch, require_torch_fp16, slow, torch_device
  from ...generation.test_utils import GenerationTesterMixin
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask
  from ...test_pipeline_mixin import PipelineTesterMixin
label_desc: Use image node_id 20 for calling the MegaModelTest obj's underlying member method code with example usage: obj.test_sequence_classification_model() without return types