docstr: z_p: Input distribution
  logs_q: LogVariance of target distrubution
  m_p: Mean of input distrubution
  logs_p: LogVariance of input distrubution
docstr_tok: ["z_p",":","Input","distribution","logs_q",":","LogVariance","of","target","distrubution","m_p",":","Mean","of","input","distrubution","logs_p",":","LogVariance","of","input","distrubution"]
code: def forward(self, z_p, logs_q, m_p, logs_p, z_mask):
      """
      z_p: Input distribution
      logs_q: LogVariance of target distrubution
      m_p: Mean of input distrubution
      logs_p: LogVariance of input distrubution
      """
      z_p = z_p.float()
      logs_q = logs_q.float()
      m_p = m_p.float()
      logs_p = logs_p.float()
      z_mask = z_mask.float()
  
      kl = logs_p - logs_q - 0.5
      kl += 0.5 * ((z_p - m_p) ** 2) * torch.exp(-2.0 * logs_p)
      kl = torch.sum(kl * z_mask)
      l = kl / torch.sum(z_mask)
      return l
  
imports: import torch
  from nemo.core.classes import Loss, typecheck
  from nemo.core.neural_types.elements import LossType, VoidType
  from nemo.core.neural_types.neural_type import NeuralType
label_desc: Use image node_id 3 for calling the KlLoss obj's underlying member method code with example usage: obj.forward(z_p, logs_q, m_p, logs_p, z_mask) and returns: l