code: def test_retain_grad_hidden_states_attentions(self):
      unittest.skip(
          "CPMAnt doesn't support retain grad in hidden_states or attentions, because prompt management will peel off the output.hidden_states from graph.\
                   So is attentions. We strongly recommand you use loss to tune model."
      )(self.test_retain_grad_hidden_states_attentions)
  
imports: import unittest
  from transformers.testing_utils import is_torch_available, require_torch, tooslow
  from ...generation.test_utils import torch_device
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, ids_tensor
  from ...test_pipeline_mixin import PipelineTesterMixin
label_desc: Use image node_id 4 for calling the CpmAntModelTest obj's underlying member method code with example usage: obj.test_retain_grad_hidden_states_attentions() without return types