def forward(self, inputs):
"""
A 1D dilated convolution w/ padding such that the output
is the same size as the input.
:param inputs: (batch size, # channels, height)
:return: (batch size, # channels, height)
"""
x = F.pad(inputs.unsqueeze(2), (self.left_padding, 0, 0, 0)).squeeze(2)
return super(CausalConv1d, self).forward(x)
评论列表
文章目录