class_docstr: High Resolution Branch of MODNet
class_docstr_tok: ["High","Resolution","Branch","of","MODNet"]
code: def forward(self, img, enc2x, enc4x, lr8x):
      img2x = F.interpolate(
          img, scale_factor=1 / 2, mode="bilinear", align_corners=False
      )
      img4x = F.interpolate(
          img, scale_factor=1 / 4, mode="bilinear", align_corners=False
      )
  
      enc2x = self.tohr_enc2x(enc2x)
      hr4x = self.conv_enc2x(paddle.concat((img2x, enc2x), axis=1))
  
      enc4x = self.tohr_enc4x(enc4x)
      hr4x = self.conv_enc4x(paddle.concat((hr4x, enc4x), axis=1))
  
      lr4x = F.interpolate(
          lr8x, scale_factor=2, mode="bilinear", align_corners=False
      )
      hr4x = self.conv_hr4x(paddle.concat((hr4x, lr4x, img4x), axis=1))
  
      hr2x = F.interpolate(
          hr4x, scale_factor=2, mode="bilinear", align_corners=False
      )
      hr2x = self.conv_hr2x(paddle.concat((hr2x, enc2x), axis=1))
  
      pred_detail = None
      if self.training:
          hr = F.interpolate(
              hr2x, scale_factor=2, mode="bilinear", align_corners=False
          )
          hr = self.conv_hr(paddle.concat((hr, img), axis=1))
          pred_detail = F.sigmoid(hr)
  
      return pred_detail, hr2x
  
imports: from collections import defaultdict
  import paddle
  import paddle.nn
  import paddle.nn.functional
  import numpy
  import scipy
  import paddleseg
  from paddleseg.models import layers, losses
  from paddleseg import utils
  from paddleseg.cvlibs import manager, param_init
label_desc: Use image node_id 2 for calling the HRBranch obj's underlying member method code with example usage: obj.forward(img, enc2x, enc4x, lr8x) and returns: pred_detail,  hr2x