It depends on your end goal. If you want a conditional layer in the init function, it will be static during training. (I.e. the condition must be known before training the model and should be a condition that won’t change during training.)
But, if you want the condition to take place during training, you should make the condition during your forward pass. Then it is not possible to place the condition in a nn.Sequential.
I.e.
def forward(cond, x):
    x=self.layer1(x)
    if cond:
        x=self.relu(x)
    ...
    return x