class_docstr: KL divergence loss without flow.
docstr: Calculate KL divergence loss without flow.
  
  Args:
      m_q (Tensor): Posterior encoder projected mean (B, H, T_feats).
      logs_q (Tensor): Posterior encoder projected scale (B, H, T_feats).
      m_p (Tensor): Expanded text encoder projected mean (B, H, T_feats).
      logs_p (Tensor): Expanded text encoder projected scale (B, H, T_feats).
docstr_tok: ["Calculate","KL","divergence","loss","without","flow",".","Args",":","m_q","(","Tensor",")",":","Posterior","encoder","projected","mean","(","B",",","H",",","T_feats",")",".","logs_q","(","Tensor",")",":","Posterior","encoder","projected","scale","(","B",",","H",",","T_feats",")",".","m_p","(","Tensor",")",":","Expanded","text","encoder","projected","mean","(","B",",","H",",","T_feats",")",".","logs_p","(","Tensor",")",":","Expanded","text","encoder","projected","scale","(","B",",","H",",","T_feats",")","."]
code: def forward(
      self,
      m_q: torch.Tensor,
      logs_q: torch.Tensor,
      m_p: torch.Tensor,
      logs_p: torch.Tensor,
  ) -> torch.Tensor:
      """Calculate KL divergence loss without flow.
  
      Args:
          m_q (Tensor): Posterior encoder projected mean (B, H, T_feats).
          logs_q (Tensor): Posterior encoder projected scale (B, H, T_feats).
          m_p (Tensor): Expanded text encoder projected mean (B, H, T_feats).
          logs_p (Tensor): Expanded text encoder projected scale (B, H, T_feats).
      """
      posterior_norm = D.Normal(m_q, torch.exp(logs_q))
      prior_norm = D.Normal(m_p, torch.exp(logs_p))
      loss = D.kl_divergence(posterior_norm, prior_norm).mean()
      return loss
  
imports: import torch
  import torch.distributions
label_desc: Use image node_id 1 for calling the KLDivergenceLossWithoutFlow obj's underlying member method code with example usage: obj.forward(m_q, logs_q, m_p, logs_p) and returns: loss