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

        args:
            inputs(list): List of tensor to be fused.
            shape(Tensor): A tensor with two elements like (H, W).
        
Matting/ppmatting/models/layers/tensor_fusion.py