code: def kl_divergence(
      pred_probs: torch.Tensor,
      target_probs: torch.Tensor,
      epsilon: float = 1e-6,
  ) -> torch.Tensor:
      """Computes the elementwise KL-Divergence loss between probability distributions
      from generated samples and target samples.
  
      Args:
          pred_probs (torch.Tensor): Probabilities for each label obtained
              from a classifier on generated audio. Expected shape is [B, num_classes].
          target_probs (torch.Tensor): Probabilities for each label obtained
              from a classifier on target audio. Expected shape is [B, num_classes].
          epsilon (float): Epsilon value.
      Returns:
          kld (torch.Tensor): KLD loss between each generated sample and target pair.
      """
      kl_div = torch.nn.functional.kl_div(
          (pred_probs + epsilon).log(), target_probs, reduction="none"
      )
      return kl_div.sum(-1)
  
imports: import contextlib
  from functools import partial
  import logging
  import os
  import typing
  import torch
  import torchmetrics
  from ..data.audio_utils import convert_audio
label_desc: Use image node_id 1 for calling a global function with example usage: kl_divergence(pred_probs, target_probs, epsilon) and returns: kl_div