class_docstr: Implementation of a multiscale vision transformer block. Each block contains a
  multiscale attention layer and a Mlp layer.
  
  ::
  
  
                                    Input
                                      |-------------------+
                                      ↓                   |
                                     Norm                 |
                                      ↓                   |
                              MultiScaleAttention        Pool
                                      ↓                   |
                                   DropPath               |
                                      ↓                   |
                                  Summation ←-------------+
                                      |
                                      |-------------------+
                                      ↓                   |
                                     Norm                 |
                                      ↓                   |
                                     Mlp                 Proj
                                      ↓                   |
                                   DropPath               |
                                      ↓                   |
                                  Summation  ←------------+
docstr: Args:
      x (torch.Tensor): Input tensor.
      thw_shape (List): The shape of the input tensor (before flattening).
docstr_tok: ["Args",":","x","(","torch.Tensor",")",":","Input","tensor",".","thw_shape","(","List",")",":","The","shape","of","the","input","tensor","(","before","flattening",")","."]
code: def forward(
      self, x: torch.Tensor, thw_shape: List[int]
  ) -> Tuple[torch.Tensor, List[int]]:
      """
      Args:
          x (torch.Tensor): Input tensor.
          thw_shape (List): The shape of the input tensor (before flattening).
      """
  
      x_block, thw_shape_new = self.attn(
          x,
          thw_shape,
      )
  
      if self.pool_skip is None:
          x_res = x
      else:
          x_res, res_shape = _pre_attention_pool(
              x, [thw_shape[0], thw_shape[1], thw_shape[2]]
          )
          x_res = self.pool_skip(x_res)
          x_res, _ = _post_attention_pool(x_res, res_shape)
  
      x = x_res + self.drop_path(x_block)
      x_norm = x
      x_mlp = self.mlp(x_norm)
      if self.dim != self.dim_out:
          x = self.proj(x_norm)
      x = x + self.drop_path(x_mlp)
      return x, thw_shape_new
  
imports: from typing import List, Optional, Tuple
  import numpy
  import torch
  import torch.fx
  import torch.nn
  from torch.nn.common_types import _size_3_t
  from .drop_path import DropPath
label_desc: Use image node_id 2 for calling the ScriptableMultiScaleBlock obj's underlying member method code with example usage: obj.forward(x, thw_shape) and returns: x,  thw_shape_new