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 forward(self, x):
      # x: BCHW
      _, num_c, _, _ = x.shape
      if self.gamma1 is not None:
          gamma1 = self.gamma1.view(num_c, 1, 1)
      else:
          gamma1 = 1
      x = x + self.drop_path(gamma1 * self.gnconv(self.norm1(x)))
  
      x_input = x
      x = x.permute(0, 2, 3, 1)  # (N, C, H, W) -> (N, H, W, C)
      x = self.norm2(x)
      x = self.pwconv1(x)
      x = self.act(x)
      x = self.pwconv2(x)
      if self.gamma2 is not None:
          x = self.gamma2 * x
      x = x.permute(0, 3, 1, 2)  # (N, H, W, C) -> (N, C, H, W)
  
      x = x_input + self.drop_path(x)
      return x
  
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 2 for calling the Block obj's underlying member method code with example usage: obj.forward(x) and returns: x