Log-likelihood for normal distribution

I have a VAE that generates mean and var as output. So the size of the output heads is [B, 1, 28, 28]. I want to calculate the loglike loss. How can I do that? In pytorch vae tutorial, I see that they used bce loss but it doesn’t work here. Does anyone have any idea how to implement it?