class_docstr: Implementation of one MetaFormer block.
  Args:
      dim (int): embedding dimension
      mlp_ratio (float): mlp ratio
      act_layer (nn.module): activation layer
      norm_layer (nn.module): normalization layer
      drop (float): drop out rate
      drop_path (float): stochastic depth
      use_layer_scale (bool): use layer scale
code: def __init__(
      self,
      dim,
      token_mixer=nn.Identity,
      mlp_ratio=4.0,
      act_layer=nn.GELU,
      norm_layer=LayerNormChannel,
      drop=0.0,
      drop_path=0.0,
      use_layer_scale=True,
      layer_scale_init_value=1e-5,
  ):
      super().__init__()
  
      self.norm1 = norm_layer(dim)
      self.token_mixer = token_mixer(dim=dim)
      self.norm2 = norm_layer(dim)
      mlp_hidden_dim = int(dim * mlp_ratio)
      self.mlp = Mlp(
          in_features=dim,
          hidden_features=mlp_hidden_dim,
          act_layer=act_layer,
          drop=drop,
      )
      self.drop_path1 = (
          DropPath(drop_path) if drop_path > 0.0 else nn.Identity()
      )
  
      self.drop_path = (
          DropPath(drop_path) if drop_path > 0.0 else nn.Identity()
      )
      self.use_layer_scale = use_layer_scale
      if use_layer_scale:
          self.layer_scale_1 = nn.Parameter(
              layer_scale_init_value * torch.ones(dim),
              requires_grad=True,
          )
          self.layer_scale_2 = nn.Parameter(
              layer_scale_init_value * torch.ones(dim),
              requires_grad=True,
          )
  
      self.drop_path2 = (
          DropPath(drop_path) if drop_path > 0.0 else nn.Identity()
      )
  
file_path: towhee/towhee/models/metaformer/metaformerblock.py
imports: from torch import nn
  import torch
  from towhee.models.layers.droppath import DropPath
  from towhee.models.poolformer.layernormchannel import LayerNormChannel
  from towhee.models.poolformer.mlp import Mlp
label_desc: Use image node_id 1 to create a new MetaFormerBlock object from inherited base classes: nn with example: obj = MetaFormerBlock(dim, token_mixer, mlp_ratio, act_layer, norm_layer, drop, drop_path, use_layer_scale, layer_scale_init_value)