I am trying to implement the same NN. This is the way I build the residual blocks:
class ResidualBlock(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride):
    super(ResidualBlock, self).__init__()

    self.conv1 = nn.Conv1d(in_channels, out_channels, kernel_size)
    self.conv2 = nn.Conv1d(in_channels, out_channels, kernel_size)
    self.max_pool = nn.MaxPool1d(kernel_size, stride)


def forward(self, x):
    residual = x

    out = F.relu(self.conv1(x))
    out = F.relu(self.conv2(out))

    out += residual

    out = self.max_pool(F.relu(out))

    return out

However, I am having problems because the residual’s shape doesn’t match the output’s shape of the second conv layer. Any idea to solve the problem?