The KL term of the VAE loss
Structure check. The site checks the solution structure. Python is not executed.
Finish kl_per_dim: given mu and logvar , return the element-wise
— one term of the sum over latent dimensions.
Summing over dim=1 and averaging over the batch happen outside.
Use operators and the functions torch.exp, torch.log: method calls such as logvar.exp() are not understood by the check yet.