def forward(self, x: Tensor, cls_seg: Optional[nn.Layer]) -> Tensor:
        """Forward function.
        Args:
            x (Tensor): Input tensor.
            cls_seg (nn.Layer, optional): The classification head.

        Returns:
            Tensor: Output tensor.
        """
        x = self.conv(x)
        x = self.norm(x)
        x = self.act(x)
        if cls_seg is not None:
            x = cls_seg(x)
        return x
Forward function.
        Args:
            x (Tensor): Input tensor.
            cls_seg (nn.Layer, optional): The classification head.

        Returns:
            Tensor: Output tensor.
        
paddleseg/models/pidnet.py