class_docstr: Implementation of a multiscale attention block. Compare to a conventional attention
  block, a multiscale attention block optionally supports pooling (either
  before or after qkv projection). If pooling is not used, a multiscale attention
  block is equivalent to a conventional attention block.
  
  ::
                                 Input
                                   |
                  |----------------|-----------------|
                  ↓                ↓                 ↓
                Linear           Linear            Linear
             [dim expand]     [dim expand]      [dim expand]
                  &                &                 &
               Pool (Q)         Pool (K)          Pool (V)
                  → -------------- ←                 |
                           ↓                         |
                     MatMul & Scale                  |
                           ↓                         |
                        Softmax                      |
                           → ----------------------- ←
                                       ↓
                                 MatMul & Scale
                                       ↓
                                    DropOut
code: def _load_from_state_dict(
      self,
      state_dict,
      prefix,
      local_metadata,
      strict,
      missing_keys,
      unexpected_keys,
      error_msgs,
  ):
      version = local_metadata.get("version", None)
  
      if version is None or version < 2:
          for layer in ["pool", "norm"]:
              for pattern in ["q", "k", "v"]:
                  for type in ["weight", "bias"]:
                      old_key = f"{prefix}{layer}_{pattern}.{type}"
                      new_key = f"{prefix}_attention_pool_{pattern}.{layer}.{type}"
                      if old_key in state_dict:
                          state_dict[new_key] = state_dict[old_key]
  
      super()._load_from_state_dict(
          state_dict,
          prefix,
          local_metadata,
          strict,
          missing_keys,
          unexpected_keys,
          error_msgs,
      )
  
imports: from typing import Callable, List, Optional, Tuple
  import numpy
  import torch
  import torch.nn
  from torch.nn.common_types import _size_3_t
  from .drop_path import DropPath
label_desc: Use image node_id 8 for calling the MultiScaleAttention obj's underlying member method code with example usage: obj._load_from_state_dict(state_dict, prefix, local_metadata, strict, missing_keys, unexpected_keys, error_msgs) without return types