class_docstr: Here we also overwrite some of the tests of test_modeling_common.py, as ViTMAE does not use input_ids, inputs_embeds,
  attention_mask and seq_length.
code: def test_save_load(self):
      (
          config,
          inputs_dict,
      ) = self.model_tester.prepare_config_and_inputs_for_common()
  
      for model_class in self.all_model_classes:
          model = model_class(config)
          model.to(torch_device)
          model.eval()
          # make random mask reproducible
          torch.manual_seed(2)
          with torch.no_grad():
              outputs = model(
                  **self._prepare_for_class(inputs_dict, model_class)
              )
  
          out_2 = outputs[0].cpu().numpy()
          out_2[np.isnan(out_2)] = 0
  
          with tempfile.TemporaryDirectory() as tmpdirname:
              model.save_pretrained(tmpdirname)
              model = model_class.from_pretrained(tmpdirname)
              model.to(torch_device)
              # make random mask reproducible
              torch.manual_seed(2)
              with torch.no_grad():
                  after_outputs = model(
                      **self._prepare_for_class(
                          inputs_dict, model_class
                      )
                  )
  
              # Make sure we don't have nans
              out_1 = after_outputs[0].cpu().numpy()
              out_1[np.isnan(out_1)] = 0
              max_diff = np.amax(np.abs(out_1 - out_2))
              self.assertLessEqual(max_diff, 1e-5)
  
imports: import inspect
  import math
  import tempfile
  import unittest
  import numpy
  from transformers import ViTMAEConfig
  from transformers.testing_utils import require_torch, require_vision, slow, torch_device
  from transformers.utils import cached_property, is_torch_available, is_vision_available
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
label_desc: Use image node_id 9 for calling the ViTMAEModelTest obj's underlying member method code with example usage: obj.test_save_load() without return types