class_docstr: The Bilateral Guided Aggregation Layer, used to fuse the semantic features and spatial features.
class_docstr_tok: ["The","Bilateral","Guided","Aggregation","Layer",",","used","to","fuse","the","semantic","features","and","spatial","features","."]
code: def forward(self, dfm: int, sfm: int) -> paddle.Tensor:
      db_feat_keep = self.db_branch_keep(dfm)
      db_feat_down = self.db_branch_down(dfm)
      sb_feat_keep = self.sb_branch_keep(sfm)
  
      sb_feat_up = self.sb_branch_up(sfm)
      sb_feat_up = F.interpolate(
          sb_feat_up,
          paddle.shape(db_feat_keep)[2:],
          mode="bilinear",
          align_corners=self.align_corners,
      )
  
      sb_feat_up = F.sigmoid(sb_feat_up)
      db_feat = db_feat_keep * sb_feat_up
  
      sb_feat = db_feat_down * sb_feat_keep
      sb_feat = F.interpolate(
          sb_feat,
          paddle.shape(db_feat)[2:],
          mode="bilinear",
          align_corners=self.align_corners,
      )
  
      return self.conv(db_feat + sb_feat)
  
imports: import os
  from typing import Union, List, Tuple
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddlehub.module.module import moduleinfo
  import paddlehub.vision.segmentation_transforms
  from paddlehub.module.cv_module import ImageSegmentationModule
  import bisenet_cityscapes.layers
label_desc: Use image node_id 2 for calling the BGA obj's underlying member method code with example usage: obj.forward(dfm, sfm) and returns: self