You can first construct a python list of nn.Modules and unpack it into a nn.Sequential
import torch.nn as nn

modules = []
modules.append(nn.Linear(10, 10))
modules.append(nn.Linear(10, 10))

sequential = nn.Sequential(*modules)