code: def forward(self, features):
      # instance features (x4 convs)
      features = self.inst_convs(features)
      # predict instance activation maps
      iam = self.iam_conv(features)
      iam_prob = iam.sigmoid()
  
      B, N = iam_prob.shape[:2]
      C = features.size(1)
      # BxNxHxW -> BxNx(HW)
      iam_prob = iam_prob.view(B, N, -1)
      normalizer = iam_prob.sum(-1).clamp(min=1e-6)
      iam_prob = iam_prob / normalizer[:, :, None]
      # aggregate features: BxCxHxW -> Bx(HW)xC
      inst_features = torch.bmm(
          iam_prob, features.view(B, C, -1).permute(0, 2, 1)
      )
      # predict classification & segmentation kernel & objectness
      pred_logits = self.cls_score(inst_features)
      pred_kernel = self.mask_kernel(inst_features)
      pred_scores = self.objectness(inst_features)
      return pred_logits, pred_kernel, pred_scores, iam
  
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
  from mmengine.model.weight_init import caffe2_xavier_init, kaiming_init
  from torch.nn import init
  from mmdet.registry import MODELS
label_desc: Use image node_id 3 for calling the InstanceBranch obj's underlying member method code with example usage: obj.forward(features) and returns: pred_logits,  pred_kernel,  pred_scores,  iam