class_docstr: This class implements the task-specific Lingvo ASR model of Qin et al. (2019).
  
  The estimator uses a pre-trained model provided by Qin et al., which is trained using the Lingvo library and the
  LibriSpeech dataset.
  
  | Paper link: http://proceedings.mlr.press/v97/qin19a.html, https://arxiv.org/abs/1902.08295
  
  .. warning:: In order to calculate loss gradients, this estimator requires a user-patched Lingvo module. A patched
               source file for the `lingvo.tasks.asr.decoder` module will be automatically applied. The original
               source file can be found in `<PYTHON_SITE_PACKAGES>/lingvo/tasks/asr/decoder.py` and will be patched as
               outlined in the following commit diff:
               https://github.com/yaq007/lingvo/commit/414e035b2c60372de732c9d67db14d1003be6dd6
  
  The patched `decoder_patched.py` can be found in `ART_DATA_PATH/lingvo/asr`.
  
  Note: Run `python -m site` to obtain a list of possible candidates where to find the `<PYTHON_SITE_PACKAGES` folder.
docstr: Define and instantiate the computation graph.
docstr_tok: ["Define","and","instantiate","the","computation","graph","."]
code: def _load_model(self):
      """
      Define and instantiate the computation graph.
      """
      import tensorflow.compat.v1 as tf1
      from lingvo import model_registry, model_imports
      from lingvo.core import cluster_factory
  
      from asr.librispeech import Librispeech960Wpm
  
      # check and download patched Lingvo ASR decoder
      _ = self._check_and_download_file(
          self._LINGVO_CFG["decoder"]["uri"],
          self._LINGVO_CFG["decoder"]["basename"],
          self._LINGVO_CFG["path"],
          "asr",
      )
  
      # monkey-patch the lingvo.asr.decoder.AsrDecoderBase._ComputeMetrics method with patched method according
      # to Qin et al
      from lingvo.tasks.asr import decoder
      from asr import decoder_patched
  
      decoder.AsrDecoderBase._ComputeMetrics = (
          decoder_patched.AsrDecoderBase._ComputeMetrics
      )  # pylint: disable=W0212
  
      # check and download Lingvo ASR vocab
      # vocab_path = self._check_and_download_vocab()
      vocab_path = self._check_and_download_file(
          self._LINGVO_CFG["vocab"]["uri"],
          self._LINGVO_CFG["vocab"]["basename"],
          self._LINGVO_CFG["path"],
          "asr",
      )
  
      # monkey-patch tasks.asr.librispeechLibriSpeech960Wpm class attribute WPM_SYMBOL_TABLE_FILEPATH
      Librispeech960Wpm.WPM_SYMBOL_TABLE_FILEPATH = vocab_path
  
      # register model params
      model_name = "asr.librispeech.Librispeech960Wpm"
      model_imports.ImportParams(model_name)
      params = model_registry._ModelRegistryHelper.GetParams(
          model_name, "Test"
      )  # pylint: disable=W0212
  
      # set random seed parameter
      if self.random_seed is not None:
          params.random_seed = self.random_seed
  
      # instantiate Lingvo ASR model
      cluster = cluster_factory.Cluster(params.cluster)
      with cluster, tf1.device(cluster.GetPlacer()):
          model = params.Instantiate()
          task = model.GetTask()
  
      # load Qin et al. pretrained model
      _ = self._check_and_download_file(
          self._LINGVO_CFG["model_data"]["uri"],
          self._LINGVO_CFG["model_data"]["basename"],
          self._LINGVO_CFG["path"],
          "asr",
          "model",
      )
      model_index_path = self._check_and_download_file(
          self._LINGVO_CFG["model_index"]["uri"],
          self._LINGVO_CFG["model_index"]["basename"],
          self._LINGVO_CFG["path"],
          "asr",
          "model",
      )
      self.sess.run(tf1.global_variables_initializer())
      saver = tf1.train.Saver(
          [
              var
              for var in tf1.global_variables()
              if var.name.startswith("librispeech")
          ]
      )
      saver.restore(self.sess, os.path.splitext(model_index_path)[0])
  
      # set 'enable_asserts'-flag to False (Note: this flag ensures correct GPU support)
      tf1.flags.FLAGS.enable_asserts = False
  
      return model, task, cluster
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import os
  import sys
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
  import numpy
  from art import config
  from art.estimators.speech_recognition.speech_recognizer import SpeechRecognizerMixin
  from art.estimators.tensorflow import TensorFlowV2Estimator
  from art.utils import get_file, make_directory
label_desc: Use image node_id 5 for calling the TensorFlowLingvoASR obj's underlying member method code with example usage: obj._load_model() and returns: model,  task,  cluster