code: def checkpoint_filter_fn(state_dict, model):
      """resize positional embeddings of pretrained weights"""
      pos_embed_keys = [
          k for k in state_dict.keys() if k.startswith("pos_embed_")
      ]
      for k in pos_embed_keys:
          if state_dict[k].shape != getattr(model, k).shape:
              state_dict[k] = resize_pos_embed(
                  state_dict[k], getattr(model, k)
              )
      return state_dict
  
imports: import collections.abc
  import logging
  import math
  from functools import partial
  import torch
  import torch.nn.functional
  from torch import nn
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
  from timm.layers import PatchEmbed, Mlp, DropPath, create_classifier, trunc_normal_, _assert
  from timm.layers import create_conv2d, create_pool2d, to_ntuple, use_fused_attn, LayerNorm
  from ._builder import build_model_with_cfg
  from ._features_fx import register_notrace_function
  from ._manipulate import checkpoint_seq, named_apply
  from ._registry import register_model, generate_default_cfgs, register_model_deprecations
label_desc: Use image node_id 5 for calling a global function with example usage: checkpoint_filter_fn(state_dict, model) and returns: state_dict