So, if I got this right, are you suggesting to make a list of layers and expand it into a nn.Sequential()?
In my situation I need instantiate a different number of independent layer which I will later connect in a symmetrical fashion.
Would using setattr, which takes names as strings, do the job?
Let me jot down what I intend to do.
Say number_of_layers is 2.
b - a - A - B

If number_of_layers is 3, then
c - b - a - A - B - C

And so on. And each block is fed also with other inputs. So, it’s not a simple Sequential().