code: def test_contr_mlm_multi(self, ssl_model):
      modelConfig_contr_mlm_multi = ssl_model.to_config_dict()
  
      model_defaults = modelConfig_contr_mlm_multi["model_defaults"]
  
      loss_list_contr_mlm_multi = dict(
          modelConfig_contr_mlm_multi["loss_list"]
      )
      loss_list_contr_mlm_multi["mlm_2"] = {
          "decoder": {
              "_target_": "nemo.collections.asr.modules.ConvASRDecoder",
              "feat_in": model_defaults["enc_hidden"],
              "num_classes": 4096,
          },
          "loss": {
              "_target_": "nemo.collections.asr.losses.MLMLoss",
              "combine_time_steps": 1,
          },
          "output_from_layer": "encoder.0",
          "targets_from_loss": "contr",
      }
      loss_list_contr_mlm_multi["mlm_3"] = {
          "decoder": {
              "_target_": "nemo.collections.asr.modules.ConvASRDecoder",
              "feat_in": model_defaults["enc_hidden"],
              "num_classes": 4096,
          },
          "loss": {
              "_target_": "nemo.collections.asr.losses.MLMLoss",
              "combine_time_steps": 1,
          },
          "output_from_layer": "encoder.1",
          "targets_from_loss": "contr",
      }
      modelConfig_contr_mlm_multi["loss_list"] = DictConfig(
          loss_list_contr_mlm_multi
      )
  
      ssl_model = SpeechEncDecSelfSupervisedModel(
          cfg=modelConfig_contr_mlm_multi
      )
  
      input_signal = torch.randn(size=(4, 64000))
      length = torch.randint(low=48000, high=64000, size=[4])
  
      with torch.no_grad():
          (
              spectrograms,
              spec_masks,
              encoded,
              encoded_len,
          ) = ssl_model.forward(
              input_signal=input_signal, input_signal_length=length
          )
  
          loss_value, loss_val_dict = ssl_model.decoder_loss_step(
              spectrograms, spec_masks, encoded, encoded_len
          )
  
      assert len(loss_val_dict) == 4
  
file_path: NeMo/tests/collections/asr/test_ssl_models.py
imports: import copy
  import pytest
  import torch
  from omegaconf import DictConfig, ListConfig
  from nemo.collections.asr.models import SpeechEncDecSelfSupervisedModel
label_desc: Use image node_id 4 for calling the TestSSLModel obj's underlying member method code with example usage: obj.test_contr_mlm_multi(ssl_model) without return types