class_docstr: HorNet block
  
  Args:
      dim (`int`): Feature dimension.
      drop_rate (`float`): Drop ratio.
      layer_scale_init_value (`float`): initial value to scale layer.
      gnconv (`nn.Module`): gnConv layer.
class_docstr_tok: ["HorNet","block","Args",":","dim","(","`","int","`",")",":","Feature","dimension",".","drop_rate","(","`","float","`",")",":","Drop","ratio",".","layer_scale_init_value","(","`","float","`",")",":","initial","value","to","scale","layer",".","gnconv","(","`","nn.Module","`",")",":","gnConv","layer","."]
code: def __init__(
      self,
      dim,
      drop_rate=0.0,
      layer_scale_init_value=1e-6,
      gnconv=GatedConv,
  ):
      super().__init__()
  
      self.norm1 = LayerNorm(
          dim, eps=1e-6, data_format="channels_first"
      )
      self.gnconv = gnconv(dim)  # depthwise conv
      self.norm2 = LayerNorm(dim, eps=1e-6)
      self.pwconv1 = nn.Linear(
          dim, 4 * dim
      )  # pointwise/1x1 convs, implemented with linear layers
      self.act = nn.GELU()
      self.pwconv2 = nn.Linear(4 * dim, dim)
  
      self.gamma1 = (
          nn.Parameter(
              layer_scale_init_value * torch.ones(dim),
              requires_grad=True,
          )
          if layer_scale_init_value > 0
          else None
      )
  
      self.gamma2 = (
          nn.Parameter(
              layer_scale_init_value * torch.ones(dim),
              requires_grad=True,
          )
          if layer_scale_init_value > 0
          else None
      )
      self.drop_path = (
          DropPath(drop_rate) if drop_rate > 0.0 else nn.Identity()
      )
  
file_path: towhee/towhee/models/hornet/utils.py
imports: import torch
  from torch import nn
  from towhee.models.layers.droppath import DropPath
  from towhee.models.utils.weight_init import trunc_normal_
  from towhee.models.convnext.utils import LayerNorm
label_desc: Use image node_id 1 to create a new Block object from inherited base classes: nn with example: obj = Block(dim, drop_rate, layer_scale_init_value, gnconv)