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: Initialization.
  
  :param clip_values: Tuple of the form `(min, max)` of floats or `np.ndarray` representing the minimum and
         maximum values allowed for features. If floats are provided, these will be used as the range of all
         features. If arrays are provided, each value will be considered the bound for a feature, thus
         the shape of clip values needs to match the total number of features.
  :param channels_first: Set channels first or last.
  :param preprocessing_defences: Preprocessing defence(s) to be applied by the classifier.
  :param postprocessing_defences: Postprocessing defence(s) to be applied by the classifier.
  :param preprocessing: Tuple of the form `(subtrahend, divisor)` of floats or `np.ndarray` of values to be
          used for data preprocessing. The first value will be subtracted from the input. The input will then
          be divided by the second one.
  :param random_seed: Specify a random seed.
docstr_tok: ["Initialization",".",":","param","clip_values",":","Tuple","of","the","form","`","(","min",",","max",")","`","of","floats","or","`","np.ndarray","`","representing","the","minimum","and","maximum","values","allowed","for","features",".","If","floats","are","provided",",","these","will","be","used","as","the","range","of","all","features",".","If","arrays","are","provided",",","each","value","will","be","considered","the","bound","for","a","feature",",","thus","the","shape","of","clip","values","needs","to","match","the","total","number","of","features",".",":","param","channels_first",":","Set","channels","first","or","last",".",":","param","preprocessing_defences",":","Preprocessing","defence","(","s",")","to","be","applied","by","the","classifier",".",":","param","postprocessing_defences",":","Postprocessing","defence","(","s",")","to","be","applied","by","the","classifier",".",":","param","preprocessing",":","Tuple","of","the","form","`","(","subtrahend",",","divisor",")","`","of","floats","or","`","np.ndarray","`","of","values","to","be","used","for","data","preprocessing",".","The","first","value","will","be","subtracted","from","the","input",".","The","input","will","then","be","divided","by","the","second","one",".",":","param","random_seed",":","Specify","a","random","seed","."]
code: def __init__(
      self,
      clip_values: Optional["CLIP_VALUES_TYPE"] = None,
      channels_first: Optional[bool] = None,
      preprocessing_defences: Union[
          "Preprocessor", List["Preprocessor"], None
      ] = None,
      postprocessing_defences: Union[
          "Postprocessor", List["Postprocessor"], None
      ] = None,
      preprocessing: "PREPROCESSING_TYPE" = None,
      random_seed: Optional[int] = None,
      sess: Optional["Session"] = None,
  ):
      """
      Initialization.
  
      :param clip_values: Tuple of the form `(min, max)` of floats or `np.ndarray` representing the minimum and
             maximum values allowed for features. If floats are provided, these will be used as the range of all
             features. If arrays are provided, each value will be considered the bound for a feature, thus
             the shape of clip values needs to match the total number of features.
      :param channels_first: Set channels first or last.
      :param preprocessing_defences: Preprocessing defence(s) to be applied by the classifier.
      :param postprocessing_defences: Postprocessing defence(s) to be applied by the classifier.
      :param preprocessing: Tuple of the form `(subtrahend, divisor)` of floats or `np.ndarray` of values to be
              used for data preprocessing. The first value will be subtracted from the input. The input will then
              be divided by the second one.
      :param random_seed: Specify a random seed.
      """
      import pkg_resources
  
      import tensorflow.compat.v1 as tf1
  
      # Super initialization
      super().__init__(
          model=None,
          clip_values=clip_values,
          channels_first=channels_first,
          preprocessing_defences=preprocessing_defences,
          postprocessing_defences=postprocessing_defences,
          preprocessing=preprocessing,
      )
      self.random_seed = random_seed
      if self.postprocessing_defences is not None:  # pragma: no cover
          raise ValueError(
              "This estimator does not support `postprocessing_defences`."
          )
  
      self._input_shape = None
  
      # check required TensorFlow version
      if tf1.__version__ != "2.1.0":  # pragma: no cover
          raise AssertionError(
              "The Lingvo estimator only supports TensorFlow 2.1.0."
          )
  
      # check required Python version
      if sys.version_info[:2] != (3, 6):  # pragma: no cover
          raise AssertionError(
              "The Lingvo estimator only supports Python 3.6."
          )
  
      # check required Lingvo version
      if (
          pkg_resources.get_distribution("lingvo").version != "0.6.4"
      ):  # pragma: no cover
          raise AssertionError(
              "The Lingvo estimator only supports Lingvo 0.6.4"
          )
  
      # disable eager execution as Lingvo uses tensorflow.compat.v1 API
      tf1.disable_eager_execution()
  
      # init necessary local Lingvo ASR namespace and flags
      sys.path.append(self._LINGVO_CFG["path"])
      tf1.flags.FLAGS(tuple(sys.argv[0]))
  
      # check and download additional Lingvo ASR params file
      _ = self._check_and_download_file(
          self._LINGVO_CFG["params"]["uri"],
          self._LINGVO_CFG["params"]["basename"],
          self._LINGVO_CFG["path"],
          "asr",
      )
  
      # placeholders
      self._x_padded: "Tensor" = tf1.placeholder(
          tf1.float32, shape=[None, None], name="art_x_padded"
      )
      self._y_target: "Tensor" = tf1.placeholder(
          tf1.string, name="art_y_target"
      )
      self._mask_frequency: "Tensor" = tf1.placeholder(
          tf1.float32, shape=[None, None, 80], name="art_mask_frequency"
      )
  
      # init Lingvo computation graph
      self._sess: "Session" = tf1.Session() if sess is None else sess
      model, task, cluster = self._load_model()
      self._model = model
      self._task = task
      self._cluster = cluster
      self._metrics: Optional[
          Tuple[
              Union[
                  Dict[str, "Tensor"],
                  Dict[str, Tuple["Tensor", "Tensor"]],
              ],
              ...,
          ]
      ] = None
  
      # add prediction and loss gradient ops to graph
      self._predict_batch_op: Dict[str, "Tensor"] = self._predict_batch(
          self._x_padded, self._y_target, self._mask_frequency
      )
      self._loss_gradient_op: "Tensor" = self._loss_gradient(
          self._x_padded, self._y_target, self._mask_frequency
      )
  
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 1 to create a new TensorFlowLingvoASR object from inherited base classes: SpeechRecognizerMixin, TensorFlowV2Estimator with example: obj = TensorFlowLingvoASR(clip_values, channels_first, preprocessing_defences, postprocessing_defences, preprocessing, random_seed, sess)