class_docstr: Multi-level features are fused adaptively by obtaining spatial attention.
  
  Args:
      in_channels(list): The channels of input tensors.
      mid_channles(list): The middle channels while fusing the features.
      out_channel(int): The output channel after fusing.
      merge_type(str): Which type to merge the multi features before output. 
          It should be one of ('add', 'concat'). Default: 'concat'.
docstr: args:
      inputs(list): List of tensor to be fused.
      shape(Tensor): A tensor with two elements like (H, W).
docstr_tok: ["args",":","inputs","(","list",")",":","List","of","tensor","to","be","fused",".","shape","(","Tensor",")",":","A","tensor","with","two","elements","like","(","H",",","W",")","."]
code: def forward(self, inputs, shape):
      """
      args:
          inputs(list): List of tensor to be fused.
          shape(Tensor): A tensor with two elements like (H, W).
      """
      feas = []
      for i, input in enumerate(inputs):
          x = self.pwconvs[i](input)
          x = F.interpolate(
              x, size=shape, mode="bilinear", align_corners=False
          )
          x = self.dwconvs[i](x)
          feas.append(x)
  
      atten = helper.avg_max_reduce_channel(feas)
      atten = F.sigmoid(self.conv_atten(atten))
  
      feas_att = []
      for i, fea in enumerate(feas):
          fea = fea * (atten[:, i, :, :].unsqueeze(1))
          feas_att.append(fea)
      if self.merge_type == "concat":
          out = paddle.concat(feas_att, axis=1)
      else:
          out = sum(feas_att)
  
      out = self.conv_out(out)
      return out
  
file_path: PaddleSeg/Matting/ppmatting/models/layers/tensor_fusion.py
imports: import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.models import layers
  from ppmatting.models.layers import tensor_fusion_helper
label_desc: Use image node_id 2 for calling the MLFF obj's underlying member method code with example usage: obj.forward(inputs, shape) and returns: out