yes, feel free to do this in your python code. You dont need an nn.Sequential, you can construct this as a few for-loops in your forward function of an nn.Module subclass, for example you can insert a few for-loops here: https://github.com/pytorch/examples/blob/master/mnist/main.py#L62 1.0k