class_docstr: Base class for encoder-decoder models used for self-supervised encoder pre-training
class_docstr_tok: ["Base","class","for","encoder-decoder","models","used","for","self-supervised","encoder","pre-training"]
docstr: Forward pass of the model.
  
  Args:
      input_signal: Tensor that represents a batch of raw audio signals,
          of shape [B, T]. T here represents timesteps, with 1 second of audio represented as
          `self.sample_rate` number of floating point values.
      input_signal_length: Vector of length B, that contains the individual lengths of the audio
          sequences.
      processed_signal: Tensor that represents a batch of processed audio signals,
          of shape (B, D, T) that has undergone processing via some DALI preprocessor.
      processed_signal_length: Vector of length B, that contains the individual lengths of the
          processed audio sequences.
  
  Returns:
      A tuple of 4 elements -
      1) Processed spectrograms of shape [B, D, T].
      2) Masks applied to spectrograms of shape [B, D, T].
      3) The encoded features tensor of shape [B, D, T].
      2) The lengths of the acoustic sequence after propagation through the encoder, of shape [B].
docstr_tok: ["Forward","pass","of","the","model",".","Args",":","input_signal",":","Tensor","that","represents","a","batch","of","raw","audio","signals",",","of","shape","[","B",",","T","]",".","T","here","represents","timesteps",",","with","1","second","of","audio","represented","as","`","self.sample_rate","`","number","of","floating","point","values",".","input_signal_length",":","Vector","of","length","B",",","that","contains","the","individual","lengths","of","the","audio","sequences",".","processed_signal",":","Tensor","that","represents","a","batch","of","processed","audio","signals",",","of","shape","(","B",",","D",",","T",")","that","has","undergone","processing","via","some","DALI","preprocessor",".","processed_signal_length",":","Vector","of","length","B",",","that","contains","the","individual","lengths","of","the","processed","audio","sequences",".","Returns",":","A","tuple","of","4","elements","-","1",")","Processed","spectrograms","of","shape","[","B",",","D",",","T","]",".","2",")","Masks","applied","to","spectrograms","of","shape","[","B",",","D",",","T","]",".","3",")","The","encoded","features","tensor","of","shape","[","B",",","D",",","T","]",".","2",")","The","lengths","of","the","acoustic","sequence","after","propagation","through","the","encoder",",","of","shape","[","B","]","."]
code: def forward(
      self,
      input_signal=None,
      input_signal_length=None,
      processed_signal=None,
      processed_signal_length=None,
  ):
      """
      Forward pass of the model.
  
      Args:
          input_signal: Tensor that represents a batch of raw audio signals,
              of shape [B, T]. T here represents timesteps, with 1 second of audio represented as
              `self.sample_rate` number of floating point values.
          input_signal_length: Vector of length B, that contains the individual lengths of the audio
              sequences.
          processed_signal: Tensor that represents a batch of processed audio signals,
              of shape (B, D, T) that has undergone processing via some DALI preprocessor.
          processed_signal_length: Vector of length B, that contains the individual lengths of the
              processed audio sequences.
  
      Returns:
          A tuple of 4 elements -
          1) Processed spectrograms of shape [B, D, T].
          2) Masks applied to spectrograms of shape [B, D, T].
          3) The encoded features tensor of shape [B, D, T].
          2) The lengths of the acoustic sequence after propagation through the encoder, of shape [B].
      """
      # Reset access registry
      if self.is_access_enabled():
          self.reset_registry()
  
      # Check for special flag for validation step
      if hasattr(self, "_in_validation_step"):
          in_validation_step = self._in_validation_step
      else:
          in_validation_step = False
  
      # reset module registry from AccessMixin
      if (
          (self.training or in_validation_step)
          and self.decoder_losses is not None
          and self.output_from_layer is not None
          and len(self.output_from_layer) > 0
      ):
          layer_names = list(self.output_from_layer.values())
          register_layer = any(
              [name is not None for name in layer_names]
          )
  
          if register_layer:
              self.access_cfg["save_encoder_tensors"] = True
              self.set_access_enabled(access_enabled=True)
  
      has_input_signal = (
          input_signal is not None and input_signal_length is not None
      )
      has_processed_signal = (
          processed_signal is not None
          and processed_signal_length is not None
      )
      if (has_input_signal ^ has_processed_signal) == False:
          raise ValueError(
              f"{self} Arguments ``input_signal`` and ``input_signal_length`` are mutually exclusive "
              " with ``processed_signal`` and ``processed_signal_len`` arguments."
          )
  
      if not has_processed_signal:
          processed_signal, processed_signal_length = self.preprocessor(
              input_signal=input_signal,
              length=input_signal_length,
          )
  
      if self.pen_factor:
          self.feat_pen = (
              processed_signal.float().pow(2).mean() * self.pen_factor
          )
      spectrograms = processed_signal.detach().clone()
  
      if self.dropout_features:
          processed_signal = self.dropout_features(processed_signal)
      if self.dropout_features_q:
          spectrograms = self.dropout_features_q(spectrograms)
  
      if self.apply_masking:
          processed_signal = self.spec_augmentation(
              input_spec=processed_signal,
              length=processed_signal_length,
          )
  
      masked_spectrograms = processed_signal.detach()
      spec_masks = torch.logical_and(
          masked_spectrograms < 1e-5, masked_spectrograms > -1e-5
      ).float()
      for idx, proc_len in enumerate(processed_signal_length):
          spec_masks[idx, :, proc_len:] = 0.0
  
      encoded, encoded_len = self.encoder(
          audio_signal=processed_signal, length=processed_signal_length
      )
  
      return spectrograms, spec_masks, encoded, encoded_len
  
imports: from math import ceil
  from typing import Dict, List, Optional, Union
  import torch
  import torch.nn
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from nemo.collections.asr.data import audio_to_text_dataset
  from nemo.collections.asr.data.audio_to_text_dali import DALIOutputs
  from nemo.collections.asr.data.audio_to_text_lhotse import LhotseSpeechToTextBpeDataset
  from nemo.collections.asr.parts.mixins import ASRModuleMixin
  from nemo.collections.asr.parts.preprocessing.perturb import process_augmentations
  from nemo.collections.common.data.lhotse import get_lhotse_dataloader_from_config
  from nemo.collections.common.parts.preprocessing.parsers import make_parser
  from nemo.core.classes import ModelPT
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.classes.mixins import AccessMixin, set_access_cfg
  from nemo.core.neural_types import AcousticEncodedRepresentation, AudioSignal, LabelsType, LengthsType, NeuralType, SpectrogramType
  from nemo.utils import logging
label_desc: Use image node_id 8 for calling the SpeechEncDecSelfSupervisedModel obj's underlying member method code with example usage: obj.forward(input_signal, input_signal_length, processed_signal, processed_signal_length) and returns: spectrograms,  spec_masks,  encoded,  encoded_len