之前我们使用nn.Sequential()都是直接写死的,就如下所示: # Example of using Sequential model = nn.Sequential( nn.Conv2d(,,), nn.ReLU(), nn.Conv2d(,,), nn.ReLU() ) # Example of using Sequential with OrderedDict model = nn.Sequential(OrderedDict([ (,,)), ('relu1', nn.ReLU(