I’m loding my residual models inside a loop this way
        for i in range(self.n_residual_blocks):
            self.add_module('residual_block' + str(i + 1), residualBlock(self.lSize))

My batch size is not fixed and it changes during iteration. Is it possible to change the LayerNorm paramter in each iteration I call the model.
I want it to be something like this
nn.LayerNorm(lnsize, elementwise_affine=False)
where lnsize is [batchsize,x,y]