def forward(self, input):
        """
        Forward pass for the UniDeepFsmn_dual model.

        Args:
            input (torch.Tensor): Input tensor of shape (batch_size, input_dim).

        Returns:
            torch.Tensor: The output tensor of the same shape as input, enhanced by the network.
        """
        f1 = F.relu(self.linear(input))  # Apply linear layer followed by ReLU activation
        p1 = self.project(f1)  # Project to output dimension
        x = th.unsqueeze(p1, 1)  # Add a dimension for compatibility with Conv2d
        x_per = x.permute(0, 3, 2, 1)  # Permute dimensions for convolution
        y = F.pad(x_per, [0, 0, self.lorder - 1, self.lorder - 1])  # Pad for causal convolution
        conv1_out = x_per + self.conv1(y)  # Add original input to first convolution output
        z = F.pad(conv1_out, [0, 0, self.lorder - 1, self.lorder - 1])  # Pad for second convolution
        out = conv1_out + self.conv2(z)  # Add output of second convolution
        out1 = out.permute(0, 3, 2, 1)  # Permute back to original dimensions
        return input + out1.squeeze()  # Return enhanced input

        Forward pass for the UniDeepFsmn_dual model.

        Args:
            input (torch.Tensor): Input tensor of shape (batch_size, input_dim).

        Returns:
            torch.Tensor: The output tensor of the same shape as input, enhanced by the network.
        
clearvoice/clearvoice/models/mossformer2_ss/fsmn.py