class_docstr: Global local filter.
  
  Args:
      dim (`int`): Feature dimension.
      h (`int`): Height.
      w (`int`): Width.
class_docstr_tok: ["Global","local","filter",".","Args",":","dim","(","`","int","`",")",":","Feature","dimension",".","h","(","`","int","`",")",":","Height",".","w","(","`","int","`",")",":","Width","."]
code: def forward(self, x):
      x = self.pre_norm(x)
      x1, x2 = torch.chunk(x, 2, dim=1)
      x1 = self.dw(x1)
  
      x2 = x2.to(torch.float32)
      num_b, num_c, a, b = x2.shape
      x2 = torch.fft.rfft2(x2, dim=(2, 3), norm="ortho")
  
      weight = self.complex_weight
      if not weight.shape[1:3] == x2.shape[2:4]:
          weight = nn.functional.interpolate(
              weight.permute(3, 0, 1, 2),
              size=x2.shape[2:4],
              mode="bilinear",
              align_corners=True,
          ).permute(1, 2, 3, 0)
  
      weight = torch.view_as_complex(weight.contiguous())
  
      x2 = x2 * weight
      x2 = torch.fft.irfft2(x2, s=(a, b), dim=(2, 3), norm="ortho")
  
      x = torch.cat([x1.unsqueeze(2), x2.unsqueeze(2)], dim=2).reshape(
          num_b, 2 * num_c, a, b
      )
      x = self.post_norm(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 GlobalLocalFilter obj's underlying member method code with example usage: obj.forward(x) and returns: x