class_docstr: KL-Divergence metric based on pre-trained PASST classifier on AudioSet.
  
  From: PaSST: Efficient Training of Audio Transformers with Patchout
  Paper: https://arxiv.org/abs/2110.05069
  Implementation: https://github.com/kkoutini/PaSST
  
  Follow instructions from the github repo:
  ```
  pip install 'git+https://github.com/kkoutini/passt_hear21@0.0.19#egg=hear21passt'
  ```
  
  Args:
      pretrained_length (float, optional): Audio duration used for the pretrained model.
class_docstr_tok: ["KL-Divergence","metric","based","on","pre-trained","PASST","classifier","on","AudioSet",".","From",":","PaSST",":","Efficient","Training","of","Audio","Transformers","with","Patchout","Paper",":","https",":","\/\/arxiv.org\/abs\/2110.05069","Implementation",":","https",":","\/\/github.com\/kkoutini\/PaSST","Follow","instructions","from","the","github","repo",":","``","`","pip","install","'git+https",":","\/\/github.com\/kkoutini\/passt_hear21","@","0.0.19","#","egg=hear21passt'","``","`","Args",":","pretrained_length","(","float",",","optional",")",":","Audio","duration","used","for","the","pretrained","model","."]
docstr: Process audio to feed to the pretrained model.
docstr_tok: ["Process","audio","to","feed","to","the","pretrained","model","."]
code: def _process_audio(
      self, wav: torch.Tensor, sample_rate: int, wav_len: int
  ) -> tp.List[torch.Tensor]:
      """Process audio to feed to the pretrained model."""
      wav = wav.unsqueeze(0)
      wav = wav[..., :wav_len]
      wav = convert_audio(
          wav,
          from_rate=sample_rate,
          to_rate=self.model_sample_rate,
          to_channels=1,
      )
      wav = wav.squeeze(0)
      # we don't pad but return a list of audio segments as this otherwise affects the KLD computation
      segments = torch.split(wav, self.max_input_frames, dim=-1)
      valid_segments = []
      for s in segments:
          # ignoring too small segments that are breaking the model inference
          if s.size(-1) > self.min_input_frames:
              valid_segments.append(s)
      return [s[None] for s in valid_segments]
  
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 4 for calling the PasstKLDivergenceMetric obj's underlying member method code with example usage: obj._process_audio(wav, sample_rate, wav_len) and returns: unknown