code: def test_resolution_change(self):
      vit_b_16_224_config = self.get_vit_b_16_224_config()
      vit_b_16_896_config = copy.deepcopy(vit_b_16_224_config)
      vit_b_16_896_config["image_size"] = 896
  
      vit_b_16_224_model = build_model(vit_b_16_224_config)
      vit_b_16_896_model = build_model(vit_b_16_896_config)
  
      # test state transfer from both resolutions
      vit_b_16_224_model.set_classy_state(
          vit_b_16_896_model.get_classy_state()
      )
      vit_b_16_896_model.set_classy_state(
          vit_b_16_224_model.get_classy_state()
      )
  
      vit_b_16_448_config = copy.deepcopy(vit_b_16_224_config)
      vit_b_16_448_config["image_size"] = 448
      vit_b_16_448_model = build_model(vit_b_16_448_config)
  
      # downsampling from 896 -> 448 -> 224 should give similar results to 896 -> 224
      vit_b_16_448_model.set_classy_state(
          vit_b_16_896_model.get_classy_state()
      )
      vit_b_16_224_model.set_classy_state(
          vit_b_16_448_model.get_classy_state()
      )
  
      vit_b_16_224_model_2 = build_model(vit_b_16_224_config)
      vit_b_16_224_model_2.set_classy_state(
          vit_b_16_896_model.get_classy_state()
      )
  
      # we should have similar position embeddings in both models
      state_1 = vit_b_16_224_model.get_classy_state()["model"]["trunk"][
          "encoder.pos_embedding"
      ]
      state_2 = vit_b_16_224_model_2.get_classy_state()["model"][
          "trunk"
      ]["encoder.pos_embedding"]
      diff = state_1 - state_2
      self.assertLess(
          diff.norm() / min(state_1.norm(), state_2.norm()), 0.1
      )
  
file_path: ClassyVision/test/models_vision_transformer_test.py
imports: import copy
  import unittest
  import torch
  from classy_vision.models import build_model
  from test.generic.utils import compare_model_state
label_desc: Use image node_id 9 for calling the TestVisionTransformer obj's underlying member method code with example usage: obj.test_resolution_change() without return types