OK, maybe I’m simply confused (I’ve edited my previous posts, fixing some names).
My BuildModel class would like to build a model based on a variable number of layers Template (which come in two types, represented before with lowercase and uppercase single letters).
The most straightforward solution would be creating two lists lower and UPPER, where I can reference the instance of my Template class. Doing so would create troubles with the current non-recursive implementation of nn.Module.__setattr__().
OK, I’m going to write them down in an extended form and create a BuildOneLayerModel() and BuildTwoLayerModel(). Perhaps I can later see a pattern and generalise to a BuildModel(number_of_layer) class.