Thank you for your response. How would I add these parameters to my optimizer? Because optim expects my parameters to be of the generator type.
model = Glow(1, 1, 10)
params = []
for block in model.blocks:
    params.append(list(block.prior.parameters()))

optimizer = optim.Adam(params, lr=lr) #TypeError: optimizer can only optimize Tensors, but one of the params is list