code: def checkpoint_filter_fn(state_dict, model):
      out_dict = {}
      state_dict = state_dict.get("model", state_dict)
      for k, v in state_dict.items():
          # original model had unused norm layers, removing them requires filtering pretrained checkpoints
          if (
              k.startswith("norm1")
              or (
                  k.startswith("norm2")
                  and getattr(model, "norm2", None) is None
              )
              or (
                  k.startswith("norm3")
                  and getattr(model, "norm3", None) is None
              )
              or (
                  k.startswith("norm4")
                  and getattr(model, "norm4", None) is None
              )
              or (
                  k.startswith("aggregate")
                  and getattr(model, "aggregate", None) is None
              )
              or (
                  k.startswith("head")
                  and getattr(model, "head", None) is None
              )
          ):
              continue
          out_dict[k] = v
      return out_dict
  
imports: from functools import partial
  from typing import Tuple, List, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
  from timm.layers import PatchEmbed, Mlp, DropPath, to_2tuple, trunc_normal_, _assert, LayerNorm
  from ._builder import build_model_with_cfg
  from ._registry import register_model, generate_default_cfgs
label_desc: Use image node_id 3 for calling a global function with example usage: checkpoint_filter_fn(state_dict, model) and returns: out_dict