ptrblck:

__init__


Thanks for the suggestion. I still have to figure those out. I will look into it.
Before that if you can jump directely to DepthwiseSeparableConv Class, when i am trying to return two values. I am facing TypeError: ‘DepthwiseSeparableConv’ object is not iterable.
If I am trying to return one value, its working fine.
Can you explain me the error?
class DepthwiseSeparableConv(nn.Module):
    def __init__(self, H, B, kernel_size,
                 stride, padding, dilation, norm_type="gLN", causal=False):
        super(DepthwiseSeparableConv, self).__init__()
        # Use `groups` option to implement depthwise convolution
        # [M, H, K] -> [M, H, K]
        depthwise_conv = nn.Conv1d(H, H, kernel_size,
                                   stride=stride, padding=padding,
                                   dilation=dilation, groups=H,
                                   bias=False)
        if causal:
            chomp = Chomp1d(padding)
        prelu = nn.PReLU()
        norm = chose_norm(norm_type, H)
        # [M, H, K] -> [M, B, K]
        pointwise_conv = nn.Conv1d(H, B, 1, bias=False)
        # Put together
        if causal:
            self.net1 = nn.Sequential(depthwise_conv, chomp, prelu, norm,
                                     pointwise_conv)
            self.net2 = nn.Sequential(depthwise_conv, chomp, prelu, norm,
                                     pointwise_conv)
            
        else:
            self.net1 = nn.Sequential(depthwise_conv, prelu, norm,
                                     pointwise_conv)
            self.net2 = nn.Sequential(depthwise_conv, chomp, prelu, norm,
                                     pointwise_conv)

    def forward(self, x):
        """
        Args:
            x: [M, H, K]
        Returns:
            result: [M, B, K]
        """
        return self.net1(x),self.net2(x)