code: def test_pretrained_ambernet_logits_batched(self, test_data_dir):
      model_name = "langid_ambernet"
      lang_model = EncDecSpeakerLabelModel.from_pretrained(model_name)
      relative_filepath = (
          "an4_speaker/an4/wav/an4_clstk/fash/an255-fash-b.wav"
      )
      filename = os.path.join(test_data_dir, relative_filepath)
      device = "cuda" if torch.cuda.is_available() else "cpu"
  
      with tempfile.TemporaryDirectory() as tmpdir:
          temp_manifest = os.path.join(tmpdir, "manifest.json")
          with open(temp_manifest, "w", encoding="utf-8") as fp:
              entry = {
                  "audio_filepath": filename,
                  "duration": 4.5,
                  "label": "en",
              }
              fp.write(json.dumps(entry) + "\n")
              entry = {
                  "audio_filepath": filename,
                  "duration": 4.5,
                  "label": "test",
              }  # test sample outside of training set
              fp.write(json.dumps(entry) + "\n")
  
          (
              embs,
              logits,
              gt_labels,
              trained_labels,
          ) = lang_model.batch_inference(temp_manifest, device=device)
          pred_label = trained_labels[logits.argmax(axis=-1)[0]]
          true_label = gt_labels[0]
  
          assert pred_label == true_label
          assert gt_labels[1] == "test"
  
file_path: NeMo/tests/collections/asr/test_speaker_label_models.py
imports: import json
  import os
  import tempfile
  from unittest import TestCase
  import pytest
  import torch
  from omegaconf import DictConfig
  from nemo.collections.asr.models import EncDecSpeakerLabelModel
label_desc: Use image node_id 3 for calling the TestEncDecSpeechLabelModel obj's underlying member method code with example usage: obj.test_pretrained_ambernet_logits_batched(test_data_dir) without return types