def forward(self, x_p: Tensor, x_i: Tensor) -> Tensor:
        """Forward function.

        Args:
            x_p (Tensor): The featrue map from P branch.
            x_i (Tensor): The featrue map from I branch.

        Returns:
            Tensor: The feature map with pixel-attention-guided fusion.
        """
        if self.after_relu:
            x_p = self.relu(x_p)
            x_i = self.relu(x_i)

        f_i = self.f_i(x_i)
        f_i = F.interpolate(f_i,
                            size=x_p.shape[2:],
                            mode=self.upsample_mode,
                            align_corners=False)

        f_p = self.f_p(x_p)

        if self.with_channel:
            sigma = F.sigmoid(self.up(f_p * f_i))
        else:
            sigma = F.sigmoid(paddle.sum(f_p * f_i, axis=1).unsqueeze(1))

        x_i = F.interpolate(x_i,
                            size=x_p.shape[2:],
                            mode=self.upsample_mode,
                            align_corners=False)

        out = sigma * x_i + (1 - sigma) * x_p
        return out
Forward function.

        Args:
            x_p (Tensor): The featrue map from P branch.
            x_i (Tensor): The featrue map from I branch.

        Returns:
            Tensor: The feature map with pixel-attention-guided fusion.
        
paddleseg/models/backbones/pidnet.py