class_docstr: Vision Transformer with support for patch input
      
code: def init_weight(self):
      utils.load_pretrained_model(self, self.pretrained)
  
      # load and resize pos_embed
      model_path = self.pretrained
      if not os.path.exists(model_path):
          model_path = utils.download_pretrained_model(model_path)
  
      load_state_dict = paddle.load(model_path)
      model_state_dict = self.state_dict()
      pos_embed_name = "pos_embed"
      if pos_embed_name in load_state_dict.keys():
          load_pos_embed = paddle.to_tensor(
              load_state_dict[pos_embed_name], dtype="float32"
          )
          if self.pos_embed.shape != load_pos_embed.shape:
              pos_size = int(math.sqrt(load_pos_embed.shape[1] - 1))
              model_state_dict[pos_embed_name] = self.resize_pos_embed(
                  load_pos_embed,
                  (pos_size, pos_size),
                  (self.pos_h, self.pos_w),
              )
              self.set_dict(model_state_dict)
              logger.info(
                  "Load pos_embed and resize it from {} to {} .".format(
                      load_pos_embed.shape, self.pos_embed.shape
                  )
              )
  
imports: import os
  import math
  import paddle
  import paddle.nn
  import paddle.nn.functional
  import numpy
  from paddleseg.cvlibs import manager
  from paddleseg.utils import utils, logger
  from paddleseg.models.backbones.transformer_utils import to_2tuple, DropPath, Identity
label_desc: Use image node_id 2 for calling the VisionTransformer obj's underlying member method code with example usage: obj.init_weight() without return types