Making a list of layers

Hi, I want to make a list of layers for a given number n in a given loop on j iterating over n and apply them on input x as a whole. Something that I am looking for is like:

layers = ......

for j in range(n):

   layers = ...
  output = layers(x) 

Precisely, for j =1 I want to have only one FC layer and apply it on x, for j=2 I want to have two FC and apply them on x and etc. How can I do that?

I looked at MyModule class, but it doesn’t help me since the size of out_put would change. I would be thankful if you guide me.