code: def _eval_subset(
      tedlium_path,
      subset,
      feature_extractor,
      decoder,
      token_processor,
      use_cuda,
  ):
      total_edit_distance = 0
      total_length = 0
      if subset == "dev":
          dataset = torchaudio.datasets.TEDLIUM(
              tedlium_path, release="release3", subset="dev"
          )
      elif subset == "test":
          dataset = torchaudio.datasets.TEDLIUM(
              tedlium_path, release="release3", subset="test"
          )
      with torch.no_grad():
          for idx in range(len(dataset)):
              sample = dataset[idx]
              waveform = sample[0].squeeze()
              if use_cuda:
                  waveform = waveform.to(device="cuda")
              actual = sample[2].replace("\n", "")
              if actual == "ignore_time_segment_in_scoring":
                  continue
              features, length = feature_extractor(waveform)
              hypos = decoder(features, length, 20)
              hypothesis = hypos[0]
              hypothesis = token_processor(hypothesis[0])
              total_edit_distance += compute_word_level_distance(
                  actual, hypothesis
              )
              total_length += len(actual.split())
              if idx % 100 == 0:
                  print(
                      f"Processed elem {idx}; WER: {total_edit_distance / total_length}"
                  )
      print(
          f"Final WER for {subset} set: {total_edit_distance / total_length}"
      )
  
file_path: audio/examples/asr/emformer_rnnt/tedlium3/eval_pipeline.py
imports: import logging
  import pathlib
  from argparse import ArgumentParser, RawTextHelpFormatter
  import torch
  import torchaudio
  from torchaudio.prototype.pipelines import EMFORMER_RNNT_BASE_TEDLIUM3
label_desc: Use image node_id 2 for calling a global function with example usage: _eval_subset(tedlium_path, subset, feature_extractor, decoder, token_processor, use_cuda) without return types