class_docstr: Base implementation for KL Divergence metric.
  
  The KL divergence is measured between probability distributions
  of class predictions returned by a pre-trained audio classification model.
  When the KL-divergence is low, the generated audio is expected to
  have similar acoustic characteristics as the reference audio,
  according to the classifier.
class_docstr_tok: ["Base","implementation","for","KL","Divergence","metric",".","The","KL","divergence","is","measured","between","probability","distributions","of","class","predictions","returned","by","a","pre-trained","audio","classification","model",".","When","the","KL-divergence","is","low",",","the","generated","audio","is","expected","to","have","similar","acoustic","characteristics","as","the","reference","audio",",","according","to","the","classifier","."]
docstr: Get model output given provided input tensor.
  
  Args:
      x (torch.Tensor): Input audio tensor of shape [B, C, T].
      sizes (torch.Tensor): Actual audio sample length, of shape [B].
      sample_rates (torch.Tensor): Actual audio sample rate, of shape [B].
  Returns:
      probs (torch.Tensor): Probabilities over labels, of shape [B, num_classes].
docstr_tok: ["Get","model","output","given","provided","input","tensor",".","Args",":","x","(","torch.Tensor",")",":","Input","audio","tensor","of","shape","[","B",",","C",",","T","]",".","sizes","(","torch.Tensor",")",":","Actual","audio","sample","length",",","of","shape","[","B","]",".","sample_rates","(","torch.Tensor",")",":","Actual","audio","sample","rate",",","of","shape","[","B","]",".","Returns",":","probs","(","torch.Tensor",")",":","Probabilities","over","labels",",","of","shape","[","B",",","num_classes","]","."]
code: def _get_label_distribution(
      self,
      x: torch.Tensor,
      sizes: torch.Tensor,
      sample_rates: torch.Tensor,
  ) -> tp.Optional[torch.Tensor]:
      """Get model output given provided input tensor.
  
      Args:
          x (torch.Tensor): Input audio tensor of shape [B, C, T].
          sizes (torch.Tensor): Actual audio sample length, of shape [B].
          sample_rates (torch.Tensor): Actual audio sample rate, of shape [B].
      Returns:
          probs (torch.Tensor): Probabilities over labels, of shape [B, num_classes].
      """
      raise NotImplementedError(
          "implement method to extract label distributions from the model."
      )
  
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 2 for calling the KLDivergenceMetric obj's underlying member method code with example usage: obj._get_label_distribution(x, sizes, sample_rates) without return types