They way you coded it is a bit strange, people usually code it in order. If you want to do it that way then you should write something which goes through the layers/activations in the order that you want with some loops inside the forward function. Thinking in the typical structure of a neural network, in which you apply layers and then activations, you can iterate in a zip(layer_keys,activation_keys) to go in order doing layer1 act1.
As you can imagine then, the lay input and activs inputs are not necessary unless you want to use those layers depending on something special.