docstr: Do we supervised both aux outputs, lo and high scale?
  Should attention be used to combine the aux output?
  Normally we only supervise the combined 1x output
  
  If we use attention to combine the aux outputs, then
  we can use normal weighting for aux vs. cls outputs
docstr_tok: ["Do","we","supervised","both","aux","outputs",",","lo","and","high","scale","?","Should","attention","be","used","to","combine","the","aux","output","?","Normally","we","only","supervise","the","combined","1x","output","If","we","use","attention","to","combine","the","aux","outputs",",","then","we","can","use","normal","weighting","for","aux","vs.","cls","outputs"]
code: def two_scale_forward(self, x_1x):
      """
      Do we supervised both aux outputs, lo and high scale?
      Should attention be used to combine the aux output?
      Normally we only supervise the combined 1x output
  
      If we use attention to combine the aux outputs, then
      we can use normal weighting for aux vs. cls outputs
      """
      x_lo = nn.functional.interpolate(
          x_1x,
          scale_factor=0.5,
          align_corners=self.align_corners,
          mode="bilinear",
      )
      lo_outs = self.single_scale_forward(x_lo)
  
      pred_05x = lo_outs["cls_out"]
      p_lo = pred_05x
      aux_lo = lo_outs["aux_out"]
      logit_attn = lo_outs["logit_attn"]
  
      hi_outs = self.single_scale_forward(x_1x)
      pred_10x = hi_outs["cls_out"]
      p_1x = pred_10x
      aux_1x = hi_outs["aux_out"]
  
      p_lo = p_lo * logit_attn
      aux_lo = aux_lo * logit_attn
      p_lo = scale_as(p_lo, p_1x)
      aux_lo = scale_as(aux_lo, p_1x)
  
      logit_attn = scale_as(logit_attn, p_1x)
  
      # combine lo and hi predictions with attention
      joint_pred = p_lo + p_1x * (1 - logit_attn)
      joint_aux = aux_lo + aux_1x * (1 - logit_attn)
  
      output = [joint_pred, joint_aux]
  
      # Optionally, apply supervision to the multi-scale predictions
      # directly.
      scaled_pred_05x = scale_as(pred_05x, p_1x)
      output.extend([scaled_pred_05x, pred_10x])
      output.extend(output)
      return output
  
file_path: PaddleSeg/contrib/CityscapesSOTA/models/mscale_ocrnet.py
imports: import math
  import paddle
  import paddle.nn
  from paddleseg.cvlibs import manager, param_init
  from paddleseg.utils import utils
  from paddleseg.models import layers
  from .ocrnet_nv import OCRNetNV
label_desc: Use image node_id 3 for calling the MscaleOCRNet obj's underlying member method code with example usage: obj.two_scale_forward(x_1x) and returns: output