Hello!
I am having a small problem in my code snippet below. Normally, when to end the if loop, I write pass. But, here neither pass nor break works. I get an invalid syntax. I do not understand why I cannot let the code else do nothing. Could anyone find my mistake here please? Thanks!
> class ConvBlock(nn.Module):
> def __init__(self, in_channels, out_channels, down=True, use_act=True, **kwargs):
> super().__init__()
> self.conv = nn.Sequential(
> nn.Conv1d(in_channels, out_channels, padding_mode="reflect", **kwargs)
> if down
> else nn.ConvTranspose1d(in_channels, out_channels, **kwargs),
> nn.Dropout()
> if drop
> pass,
> nn.BatchNorm1d(out_channels, affine=True),
> nn.Mish(out_channels) if use_act else nn.Identity()
> )