class_docstr: High-Resolution Module for HRNet.
  
  In this module, every branch has 4 BasicBlocks/Bottlenecks. Fusion/Exchange
  is in this module.
class_docstr_tok: ["High-Resolution","Module","for","HRNet",".","In","this","module",",","every","branch","has","4","BasicBlocks\/Bottlenecks",".","Fusion\/Exchange","is","in","this","module","."]
docstr: Forward function.
docstr_tok: ["Forward","function","."]
code: def forward(self, x):
      """Forward function."""
      if self.num_branches == 1:
          return [self.branches[0](x[0])]
  
      for i in range(self.num_branches):
          x[i] = self.branches[i](x[i])
  
      x_fuse = []
      for i in range(len(self.fuse_layers)):
          y = 0
          for j in range(self.num_branches):
              if i == j:
                  y += x[j]
              elif j > i:
                  y = y + resize(
                      self.fuse_layers[i][j](x[j]),
                      size=x[i].shape[2:],
                      mode="bilinear",
                      align_corners=False,
                  )
              else:
                  y += self.fuse_layers[i][j](x[j])
          x_fuse.append(self.relu(y))
      return x_fuse
  
imports: import torch.nn
  from annotator.uniformer.mmcv.cnn import build_conv_layer, build_norm_layer, constant_init, kaiming_init
  from annotator.uniformer.mmcv.runner import load_checkpoint
  from annotator.uniformer.mmcv.utils.parrots_wrapper import _BatchNorm
  from annotator.uniformer.mmseg.ops import Upsample, resize
  from annotator.uniformer.mmseg.utils import get_root_logger
  from ..builder import BACKBONES
  from .resnet import BasicBlock, Bottleneck
label_desc: Use image node_id 6 for calling the HRModule obj's underlying member method code with example usage: obj.forward(x) and returns: x_fuse, list