code: def evaluate(asr_model, labels_map, wer):
      # Eval the model
      hypotheses = []
      references = []
      for test_batch in asr_model.test_dataloader():
          if can_gpu:
              test_batch = [x.cuda() for x in test_batch]
          with autocast():
              log_probs, encoded_len, greedy_predictions = asr_model(
                  input_signal=test_batch[0],
                  input_signal_length=test_batch[1],
              )
          hypotheses += wer.decoding.ctc_decoder_predictions_tensor(
              greedy_predictions
          )[0]
          for batch_ind in range(greedy_predictions.shape[0]):
              seq_len = test_batch[3][batch_ind].cpu().detach().numpy()
              seq_ids = test_batch[2][batch_ind].cpu().detach().numpy()
              reference = "".join(
                  [labels_map[c] for c in seq_ids[0:seq_len]]
              )
              references.append(reference)
          del test_batch
      wer_value = word_error_rate(
          hypotheses=hypotheses,
          references=references,
          use_cer=wer.use_cer,
      )
  
      return wer_value
  
file_path: NeMo/examples/asr/quantization/speech_to_text_quant_infer.py
imports: import collections
  from argparse import ArgumentParser
  from pprint import pprint
  import torch
  from omegaconf import open_dict
  from nemo.collections.asr.metrics.wer import WER, word_error_rate
  from nemo.collections.asr.models import EncDecCTCModel
  from nemo.collections.asr.parts.submodules.ctc_decoding import CTCDecoding, CTCDecodingConfig
  from nemo.utils import logging
label_desc: Use image node_id 3 for calling a global function with example usage: evaluate(asr_model, labels_map, wer) and returns: wer_value