As far as I know, you can use torch.jit.trace on torch.Distributions. And there are tests covering this use case. torch.jit.script, however, doesn’t fully work with torch.Distributions yet. Hope this helps.