ValueError: can't optimize a non-leaf Tensor

this is a pretty hacky pyro usage that mixes torch.optim and pyro.param in an unintended way. it seems you’re trying to do maximum likelihood learning. i recommend you use pyro.optim and follow this example