code: def forward(self, x):
      assert x.shape[-1] == x.shape[-2] == self.roi_feat_size
      # RoI feature transformation, downsample 2x
      x = self.convs(x)
  
      c = self.point_feat_channels
      # first-order fusion
      x_fo = [None for _ in range(self.grid_points)]
      for i, points in enumerate(self.neighbor_points):
          x_fo[i] = x[:, i * c : (i + 1) * c]
          for j, point_idx in enumerate(points):
              x_fo[i] = x_fo[i] + self.forder_trans[i][j](
                  x[:, point_idx * c : (point_idx + 1) * c]
              )
  
      # second-order fusion
      x_so = [None for _ in range(self.grid_points)]
      for i, points in enumerate(self.neighbor_points):
          x_so[i] = x[:, i * c : (i + 1) * c]
          for j, point_idx in enumerate(points):
              x_so[i] = x_so[i] + self.sorder_trans[i][j](
                  x_fo[point_idx]
              )
  
      # predicted heatmap with fused features
      x2 = torch.cat(x_so, dim=1)
      x2 = self.deconv1(x2)
      x2 = F.relu(self.norm1(x2), inplace=True)
      heatmap = self.deconv2(x2)
  
      # predicted heatmap with original features (applicable during training)
      if self.training:
          x1 = x
          x1 = self.deconv1(x1)
          x1 = F.relu(self.norm1(x1), inplace=True)
          heatmap_unfused = self.deconv2(x1)
      else:
          heatmap_unfused = heatmap
  
      return dict(fused=heatmap, unfused=heatmap_unfused)
  
file_path: insightface/detection/scrfd/mmdet/models/roi_heads/mask_heads/grid_head.py
imports: import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule, kaiming_init, normal_init
  from mmdet.models.builder import HEADS, build_loss
label_desc: Use image node_id 3 for calling the GridHead obj's underlying member method code with example usage: obj.forward(x) and returns: dict