class_docstr: Reader for TFRecords using the MediaSequence format.
  
  The TFrecords already contain images and spectrograms.
class_docstr_tok: ["Reader","for","TFRecords","using","the","MediaSequence","format",".","The","TFrecords","already","contain","images","and","spectrograms","."]
docstr: Adds DMVR pre-processors to the dataset.
  
  Args:
    is_training: whether or not in training mode.
    num_frames: number of frames per subclip.
    stride: temporal stride to sample frames.
    num_spec_frames: number of spectrogram frames.
    dataset_spec_mean: Mean of spectrograms in the dataset.
    dataset_spec_stddev: Std dev of spectrograms in the dataset.
    num_test_clips: number of test clip (1 by default). If more than one, this
      will sample multiple linearly spaced clips within each video at test
      time. If 1, then a single clip in the middle of the video is sampled.
    min_resize: frames are resized so that min width/height is min_resize.
    crop_size: final size of the frame after cropping the resized frames.
    spec_compute_online: whether to compute spectrograms on the fly.
    spec_shape: input size of spectrogram per frame.
    spec_augment: whether to apply augmentation using SpecAugment.
    spec_augment_params: parameters for SpecAugment.
    num_waveform_samples: Number of waveform samples to use, defaults to 32000
      which corresponds to two seconds at 16kHz sampling rate.
    waveform_stride: Temporal stride to sample waveform.
    zero_centering_image: whether to have images between [-1, 1] or [0, 1].
    spec_from_wave_sample_rate: spectrogram computation parameter. The sample
      rate of the input audio.
    spec_from_wave_snr: spectrogram computation parameter. Signal-to-noise
      ratio used to inject white noise. The default value None or non-positive
      values disable the noise injection. Noise is add to non-training
      examples only by default. Training noise is added if `add_train_noise`
      is `True`.
    spec_from_wave_add_gaussian_noise: Whether to add Gaussian noise.
    spec_from_wave_add_masking_noise: If the noise type is word masking noise.
    spec_from_wave_visualness_threshold: The threshold for determining the
      visual words.
    spec_from_wave_random_mask_noise_rate: The random mask noise sampling
      ratio. If 1, the word masking is deterministic. If below 1, the masking
      noise is random and each word is masked out with this chance.
    spec_from_wave_max_word_len: Maximum length of the words. This is used to
      pad and truncate noise_word_mask added to the batch dictionary in the
      word masking noise addition.
    spec_from_wave_extend_mask_boundaries_ms: If set, the start and end
      boundaries of each maksing region in the signal is extended.
    spec_from_wave_max_num_masks: Maximum number of word masks to apply. -1
      means unlimited.
    spec_from_wave_add_word_mask: If set, add masks indicating masked words
      into the batch dict. Used for computing recovery rate of the masked
      words.
    spec_from_wave_add_word_mask_info: If set, add word masking related
      information such as timestamps and masks to the batch dict. Used for
      applying masked word prediction loss.
    spec_from_wave_eval_noise_types: A tuple of noise type strings used in
      evaluation. Each string should be either `environment_noise` or
      `packet_loss_noise`.
    spec_from_wave_environment_noise_path: Path to the npy file containing
      noise waveforms in numpy array.
    spec_from_wave_eval_noise_configs: A dict of noise config dicts for each
      noise type listed in `spec_from_wave_eval_noise_types`.
    spectrogram_type: spectrogram computation parameter. The type of the
      spectrogram to be extracted from the waveform. Can be either
      `spectrogram`, `logmf`, and `mfcc`.
    spec_frame_length: spectrogram computation parameter. The length of each
      spectroram frame.
    spec_frame_step: spectrogram computation parameter. The stride of
      spectrogram frames.
    spec_num_features: spectrogram computation parameter. The number of
      spectrogram features.
    spec_lower_edge_hertz: spectrogram computation parameter. Lowest frequency
      to consider.
    spec_upper_edge_hertz: spectrogram computation parameter. Highest
      frequency to consider.
    max_num_words: Maximum number of tokens to keep from the text for each
      caption. If there are more tokens, sequence is cropped, if less, the
      caption is padded using the tokenizer pad id.
    max_num_captions: Maximum number of captions to keep. If there are more
      captions in the proto, only the first `max_num_captions` will be
      returned is `is_training` is set to `False`. If `is_training` is `True`,
      then `max_num_captions` will be randomly sampled. Finally if the proto
      contains less than `max_num_captions`, we pad with empty srings to make
      sure there are `max_num_captions` in total.
    tokenizer: An instance of a tokenizer.
    prepend_bos: Whether to prepend BOS token.
    append_eos: Whether to append EOS token.
    caption_string: Input feature name in sstable for caption.
    masked_word_pred_aligned_caption_string: The feature name to parse to
      extract the caption aligned with the timestamps. Used for the masked
      word prediction.
    masked_word_pred_max_num_tokens: Maximum number of tokens for each masked
      word.
    masked_word_pred_patch_size: The patch size used in the network
      architecture for spectrogram token embedding. Used to compute the token
      index.
    masked_word_pred_max_num_masked_input_indices: Maximum number of masked
      input tokens (spectrogram tokens).
docstr_tok: ["Adds","DMVR","pre-processors","to","the","dataset",".","Args",":","is_training",":","whether","or","not","in","training","mode",".","num_frames",":","number","of","frames","per","subclip",".","stride",":","temporal","stride","to","sample","frames",".","num_spec_frames",":","number","of","spectrogram","frames",".","dataset_spec_mean",":","Mean","of","spectrograms","in","the","dataset",".","dataset_spec_stddev",":","Std","dev","of","spectrograms","in","the","dataset",".","num_test_clips",":","number","of","test","clip","(","1","by","default",")",".","If","more","than","one",",","this","will","sample","multiple","linearly","spaced","clips","within","each","video","at","test","time",".","If","1",",","then","a","single","clip","in","the","middle","of","the","video","is","sampled",".","min_resize",":","frames","are","resized","so","that","min","width\/height","is","min_resize",".","crop_size",":","final","size","of","the","frame","after","cropping","the","resized","frames",".","spec_compute_online",":","whether","to","compute","spectrograms","on","the","fly",".","spec_shape",":","input","size","of","spectrogram","per","frame",".","spec_augment",":","whether","to","apply","augmentation","using","SpecAugment",".","spec_augment_params",":","parameters","for","SpecAugment",".","num_waveform_samples",":","Number","of","waveform","samples","to","use",",","defaults","to","32000","which","corresponds","to","two","seconds","at","16kHz","sampling","rate",".","waveform_stride",":","Temporal","stride","to","sample","waveform",".","zero_centering_image",":","whether","to","have","images","between","[","-1",",","1","]","or","[","0",",","1","]",".","spec_from_wave_sample_rate",":","spectrogram","computation","parameter",".","The","sample","rate","of","the","input","audio",".","spec_from_wave_snr",":","spectrogram","computation","parameter",".","Signal-to-noise","ratio","used","to","inject","white","noise",".","The","default","value","None","or","non-positive","values","disable","the","noise","injection",".","Noise","is","add","to","non-training","examples","only","by","default",".","Training","noise","is","added","if","`","add_train_noise","`","is","`","True","`",".","spec_from_wave_add_gaussian_noise",":","Whether","to","add","Gaussian","noise",".","spec_from_wave_add_masking_noise",":","If","the","noise","type","is","word","masking","noise",".","spec_from_wave_visualness_threshold",":","The","threshold","for","determining","the","visual","words",".","spec_from_wave_random_mask_noise_rate",":","The","random","mask","noise","sampling","ratio",".","If","1",",","the","word","masking","is","deterministic",".","If","below","1",",","the","masking","noise","is","random","and","each","word","is","masked","out","with","this","chance",".","spec_from_wave_max_word_len",":","Maximum","length","of","the","words",".","This","is","used","to","pad","and","truncate","noise_word_mask","added","to","the","batch","dictionary","in","the","word","masking","noise","addition",".","spec_from_wave_extend_mask_boundaries_ms",":","If","set",",","the","start","and","end","boundaries","of","each","maksing","region","in","the","signal","is","extended",".","spec_from_wave_max_num_masks",":","Maximum","number","of","word","masks","to","apply",".","-1","means","unlimited",".","spec_from_wave_add_word_mask",":","If","set",",","add","masks","indicating","masked","words","into","the","batch","dict",".","Used","for","computing","recovery","rate","of","the","masked","words",".","spec_from_wave_add_word_mask_info",":","If","set",",","add","word","masking","related","information","such","as","timestamps","and","masks","to","the","batch","dict",".","Used","for","applying","masked","word","prediction","loss",".","spec_from_wave_eval_noise_types",":","A","tuple","of","noise","type","strings","used","in","evaluation",".","Each","string","should","be","either","`","environment_noise","`","or","`","packet_loss_noise","`",".","spec_from_wave_environment_noise_path",":","Path","to","the","npy","file","containing","noise","waveforms","in","numpy","array",".","spec_from_wave_eval_noise_configs",":","A","dict","of","noise","config","dicts","for","each","noise","type","listed","in","`","spec_from_wave_eval_noise_types","`",".","spectrogram_type",":","spectrogram","computation","parameter",".","The","type","of","the","spectrogram","to","be","extracted","from","the","waveform",".","Can","be","either","`","spectrogram","`",",","`","logmf","`",",","and","`","mfcc","`",".","spec_frame_length",":","spectrogram","computation","parameter",".","The","length","of","each","spectroram","frame",".","spec_frame_step",":","spectrogram","computation","parameter",".","The","stride","of","spectrogram","frames",".","spec_num_features",":","spectrogram","computation","parameter",".","The","number","of","spectrogram","features",".","spec_lower_edge_hertz",":","spectrogram","computation","parameter",".","Lowest","frequency","to","consider",".","spec_upper_edge_hertz",":","spectrogram","computation","parameter",".","Highest","frequency","to","consider",".","max_num_words",":","Maximum","number","of","tokens","to","keep","from","the","text","for","each","caption",".","If","there","are","more","tokens",",","sequence","is","cropped",",","if","less",",","the","caption","is","padded","using","the","tokenizer","pad","id",".","max_num_captions",":","Maximum","number","of","captions","to","keep",".","If","there","are","more","captions","in","the","proto",",","only","the","first","`","max_num_captions","`","will","be","returned","is","`","is_training","`","is","set","to","`","False","`",".","If","`","is_training","`","is","`","True","`",",","then","`","max_num_captions","`","will","be","randomly","sampled",".","Finally","if","the","proto","contains","less","than","`","max_num_captions","`",",","we","pad","with","empty","srings","to","make","sure","there","are","`","max_num_captions","`","in","total",".","tokenizer",":","An","instance","of","a","tokenizer",".","prepend_bos",":","Whether","to","prepend","BOS","token",".","append_eos",":","Whether","to","append","EOS","token",".","caption_string",":","Input","feature","name","in","sstable","for","caption",".","masked_word_pred_aligned_caption_string",":","The","feature","name","to","parse","to","extract","the","caption","aligned","with","the","timestamps",".","Used","for","the","masked","word","prediction",".","masked_word_pred_max_num_tokens",":","Maximum","number","of","tokens","for","each","masked","word",".","masked_word_pred_patch_size",":","The","patch","size","used","in","the","network","architecture","for","spectrogram","token","embedding",".","Used","to","compute","the","token","index",".","masked_word_pred_max_num_masked_input_indices",":","Maximum","number","of","masked","input","tokens","(","spectrogram","tokens",")","."]
code: def _build(
      self,
      is_training: bool = True,
      # Video related parameters.
      num_frames: int = 32,
      stride: int = 1,
      num_spec_frames: int = 5,
      dataset_spec_mean: float = 0.0,
      dataset_spec_stddev: float = 1.0,
      num_test_clips: int = 1,
      min_resize: int = 256,
      crop_size: int = 224,
      # Audio related parameters.
      spec_compute_online: bool = False,
      spec_shape: Tuple[int, int] = (100, 80),
      spec_augment: bool = False,
      spec_augment_params=None,
      num_waveform_samples: int = 32000,
      waveform_stride: int = 1,
      zero_centering_image: bool = False,
      spec_from_wave_sample_rate: int = 16000,
      spec_from_wave_snr: float = -1.0,
      spec_from_wave_add_gaussian_noise: bool = False,
      spec_from_wave_add_masking_noise: bool = False,
      spec_from_wave_visualness_threshold: float = 0.2,
      spec_from_wave_random_mask_noise_rate: float = 0.4,
      spec_from_wave_max_word_len: int = 128,
      spec_from_wave_extend_mask_boundaries_ms: float = 0.0,
      spec_from_wave_max_num_masks: int = -1,
      spec_from_wave_add_word_mask: bool = True,
      spec_from_wave_add_word_mask_info: bool = False,
      spec_from_wave_eval_noise_types: Optional[Sequence[str]] = None,
      spec_from_wave_environment_noise_path: Optional[str] = None,
      spec_from_wave_eval_noise_configs: Optional[
          Dict[str, Dict[str, Any]]
      ] = None,
      spectrogram_type: str = "logmf",
      spec_frame_length: int = 400,  # Corresponds to 25ms with 16K sampl rate.
      spec_frame_step: int = 160,  # Corresponds to 10ms with 16K sampl rate.
      spec_num_features: int = 80,
      spec_lower_edge_hertz: float = 0.0,
      spec_upper_edge_hertz: float = 7600.0,
      # Text related parameters.
      max_num_words: int = 16,
      max_num_captions: int = 1,
      tokenizer: Optional[tokenizers.TextTokenizer] = None,
      prepend_bos: bool = True,
      append_eos: bool = True,
      caption_string: str = "caption/label/string",
      # Masked word prediction related parameters.
      masked_word_pred_aligned_caption_string: str = "caption/label/string",
      masked_word_pred_max_num_tokens: int = 8,
      masked_word_pred_patch_size: Sequence[int] = (),
      masked_word_pred_max_num_masked_input_indices: int = 64,
  ):
      """Adds DMVR pre-processors to the dataset.
  
      Args:
        is_training: whether or not in training mode.
        num_frames: number of frames per subclip.
        stride: temporal stride to sample frames.
        num_spec_frames: number of spectrogram frames.
        dataset_spec_mean: Mean of spectrograms in the dataset.
        dataset_spec_stddev: Std dev of spectrograms in the dataset.
        num_test_clips: number of test clip (1 by default). If more than one, this
          will sample multiple linearly spaced clips within each video at test
          time. If 1, then a single clip in the middle of the video is sampled.
        min_resize: frames are resized so that min width/height is min_resize.
        crop_size: final size of the frame after cropping the resized frames.
        spec_compute_online: whether to compute spectrograms on the fly.
        spec_shape: input size of spectrogram per frame.
        spec_augment: whether to apply augmentation using SpecAugment.
        spec_augment_params: parameters for SpecAugment.
        num_waveform_samples: Number of waveform samples to use, defaults to 32000
          which corresponds to two seconds at 16kHz sampling rate.
        waveform_stride: Temporal stride to sample waveform.
        zero_centering_image: whether to have images between [-1, 1] or [0, 1].
        spec_from_wave_sample_rate: spectrogram computation parameter. The sample
          rate of the input audio.
        spec_from_wave_snr: spectrogram computation parameter. Signal-to-noise
          ratio used to inject white noise. The default value None or non-positive
          values disable the noise injection. Noise is add to non-training
          examples only by default. Training noise is added if `add_train_noise`
          is `True`.
        spec_from_wave_add_gaussian_noise: Whether to add Gaussian noise.
        spec_from_wave_add_masking_noise: If the noise type is word masking noise.
        spec_from_wave_visualness_threshold: The threshold for determining the
          visual words.
        spec_from_wave_random_mask_noise_rate: The random mask noise sampling
          ratio. If 1, the word masking is deterministic. If below 1, the masking
          noise is random and each word is masked out with this chance.
        spec_from_wave_max_word_len: Maximum length of the words. This is used to
          pad and truncate noise_word_mask added to the batch dictionary in the
          word masking noise addition.
        spec_from_wave_extend_mask_boundaries_ms: If set, the start and end
          boundaries of each maksing region in the signal is extended.
        spec_from_wave_max_num_masks: Maximum number of word masks to apply. -1
          means unlimited.
        spec_from_wave_add_word_mask: If set, add masks indicating masked words
          into the batch dict. Used for computing recovery rate of the masked
          words.
        spec_from_wave_add_word_mask_info: If set, add word masking related
          information such as timestamps and masks to the batch dict. Used for
          applying masked word prediction loss.
        spec_from_wave_eval_noise_types: A tuple of noise type strings used in
          evaluation. Each string should be either `environment_noise` or
          `packet_loss_noise`.
        spec_from_wave_environment_noise_path: Path to the npy file containing
          noise waveforms in numpy array.
        spec_from_wave_eval_noise_configs: A dict of noise config dicts for each
          noise type listed in `spec_from_wave_eval_noise_types`.
        spectrogram_type: spectrogram computation parameter. The type of the
          spectrogram to be extracted from the waveform. Can be either
          `spectrogram`, `logmf`, and `mfcc`.
        spec_frame_length: spectrogram computation parameter. The length of each
          spectroram frame.
        spec_frame_step: spectrogram computation parameter. The stride of
          spectrogram frames.
        spec_num_features: spectrogram computation parameter. The number of
          spectrogram features.
        spec_lower_edge_hertz: spectrogram computation parameter. Lowest frequency
          to consider.
        spec_upper_edge_hertz: spectrogram computation parameter. Highest
          frequency to consider.
        max_num_words: Maximum number of tokens to keep from the text for each
          caption. If there are more tokens, sequence is cropped, if less, the
          caption is padded using the tokenizer pad id.
        max_num_captions: Maximum number of captions to keep. If there are more
          captions in the proto, only the first `max_num_captions` will be
          returned is `is_training` is set to `False`. If `is_training` is `True`,
          then `max_num_captions` will be randomly sampled. Finally if the proto
          contains less than `max_num_captions`, we pad with empty srings to make
          sure there are `max_num_captions` in total.
        tokenizer: An instance of a tokenizer.
        prepend_bos: Whether to prepend BOS token.
        append_eos: Whether to append EOS token.
        caption_string: Input feature name in sstable for caption.
        masked_word_pred_aligned_caption_string: The feature name to parse to
          extract the caption aligned with the timestamps. Used for the masked
          word prediction.
        masked_word_pred_max_num_tokens: Maximum number of tokens for each masked
          word.
        masked_word_pred_patch_size: The patch size used in the network
          architecture for spectrogram token embedding. Used to compute the token
          index.
        masked_word_pred_max_num_masked_input_indices: Maximum number of masked
          input tokens (spectrogram tokens).
      """
      # We set sync_random_state to True so that sample_offset_proportion is
      # the same for all modalities.
      if "rgb" in self._modalities:
          load_modalities.add_image(
              parser_builder=self.parser_builder,
              sampler_builder=self.sampler_builder,
              decoder_builder=self.decoder_builder,
              preprocessor_builder=self.preprocessor_builder,
              postprocessor_builder=self.postprocessor_builder,
              is_training=is_training,
              num_frames=num_frames,
              stride=stride,
              num_test_clips=num_test_clips,
              min_resize=min_resize,
              crop_size=crop_size,
              zero_centering_image=zero_centering_image,
              sync_random_state=True,
          )
      if "spectrogram" in self._modalities:
          if spec_compute_online:
              if spec_from_wave_eval_noise_configs is None:
                  spec_from_wave_eval_noise_configs = {}
              add_spectrogram_from_audio(
                  parser_builder=self.parser_builder,
                  sampler_builder=self.sampler_builder,
                  preprocessor_builder=self.preprocessor_builder,
                  is_training=is_training,
                  spectrogram_type=spectrogram_type,
                  sample_rate=spec_from_wave_sample_rate,
                  snr=spec_from_wave_snr,
                  add_gaussian_noise=spec_from_wave_add_gaussian_noise,
                  add_masking_noise=spec_from_wave_add_masking_noise,
                  visualness_score_threshold=spec_from_wave_visualness_threshold,
                  random_mask_noise_rate=spec_from_wave_random_mask_noise_rate,
                  max_word_len=spec_from_wave_max_word_len,
                  extend_mask_boundaries_ms=spec_from_wave_extend_mask_boundaries_ms,
                  max_num_masks=spec_from_wave_max_num_masks,
                  add_word_mask=spec_from_wave_add_word_mask,
                  add_word_mask_info=spec_from_wave_add_word_mask_info,
                  eval_noise_types=spec_from_wave_eval_noise_types,
                  environment_noise_path=spec_from_wave_environment_noise_path,
                  **spec_from_wave_eval_noise_configs,
                  frame_length=spec_frame_length,
                  frame_step=spec_frame_step,
                  num_features=spec_num_features,
                  lower_edge_hertz=spec_lower_edge_hertz,
                  upper_edge_hertz=spec_upper_edge_hertz,
                  num_frames=num_spec_frames,
                  spec_augment=spec_augment,
                  spec_augment_params=spec_augment_params,
                  zero_centering_image=zero_centering_image,
                  dataset_mean=dataset_spec_mean,
                  dataset_stddev=dataset_spec_stddev,
                  word_tokenizer=tokenizer,
                  aligned_caption_feature_name=masked_word_pred_aligned_caption_string,
                  prepend_bos=prepend_bos,
                  append_eos=append_eos,
                  max_num_word_tokens=masked_word_pred_max_num_tokens,
                  patch_size=masked_word_pred_patch_size,
                  max_num_masked_input_indices=masked_word_pred_max_num_masked_input_indices,
              )
          else:
              add_spectrogram(
                  parser_builder=self.parser_builder,
                  sampler_builder=self.sampler_builder,
                  decoder_builder=self.decoder_builder,
                  preprocessor_builder=self.preprocessor_builder,
                  postprocessor_builder=self.postprocessor_builder,
                  input_feature_name="melspec/feature/floats",
                  input_shape=spec_shape,
                  is_training=is_training,
                  num_frames=num_spec_frames,
                  num_test_clips=num_test_clips,
                  spec_augment=spec_augment,
                  spec_augment_params=spec_augment_params,
                  zero_centering_image=zero_centering_image,
                  dataset_mean=dataset_spec_mean,
                  dataset_stddev=dataset_spec_stddev,
              )
      if "waveform" in self._modalities:
          load_modalities.add_audio(
              parser_builder=self.parser_builder,
              sampler_builder=self.sampler_builder,
              postprocessor_builder=self.postprocessor_builder,
              output_feature_name="waveform",
              is_training=is_training,
              num_samples=num_waveform_samples,
              stride=waveform_stride,
              num_test_clips=num_test_clips,
              sync_random_state=True,
          )
  
      add_text(
          parser_builder=self.parser_builder,
          decoder_builder=self.decoder_builder,
          preprocessor_builder=self.preprocessor_builder,
          tokenizer=tokenizer,
          is_training=is_training,
          input_feature_name=caption_string,
          prepend_bos=prepend_bos,
          append_eos=append_eos,
          max_num_captions=max_num_captions,
          max_num_tokens=max_num_words,
          keep_raw_string=False if is_training else True,
      )
  
      add_int64(
          parser_builder=self.parser_builder,
          decoder_builder=self.decoder_builder,
          feature_name="clip/start/timestamp",
          output_name="clip/start/timestamp",
      )
      add_int64(
          parser_builder=self.parser_builder,
          decoder_builder=self.decoder_builder,
          feature_name="clip/end/timestamp",
          output_name="clip/end/timestamp",
      )
  
      def keep_only_short_videos(
          sample: builders.FeaturesDict,
      ) -> tf.Tensor:
          """Filter out the videos that are too long."""
          duration = (
              sample["clip/end/timestamp"]
              - sample["clip/start/timestamp"]
          )
          duration = tf.cast(duration, tf.float32)
          duration = duration * 1e-6
          max_duration = float(num_spec_frames)
          duration_ok = tf.reshape(tf.less(duration, max_duration), [])
          return duration_ok
  
      if is_training:
          # Filter out the videos that are too long to fit in the encoder.
          # Otherwise the model could be trained to hallucinate words corresponding
          # to the cropped-out parts of the audio input.
          self.filter_builder.add_filter_fn(
              keep_only_short_videos, builders.Phase.DECODE
          )
  
imports: import functools
  from typing import Any, Dict, Iterator, Optional, Sequence, Text, Tuple
  from absl import logging
  from dmvr import builders
  from dmvr import modalities
  from dmvr import tokenizers
  from flax import jax_utils
  import jax
  import jax.numpy
  import numpy
  from scenic.dataset_lib import dataset_utils
  from scenic.dataset_lib import datasets
  from scenic.dataset_lib import video_ops
  from scenic.projects.avatar.datasets.dataset_utils import add_int64
  from scenic.projects.avatar.datasets.dataset_utils import add_spectrogram
  from scenic.projects.avatar.datasets.dataset_utils import add_spectrogram_from_audio
  from scenic.projects.avatar.datasets.dataset_utils import add_text
  from scenic.projects.vivit.data import video_tfrecord_dataset
  import tensorflow
label_desc: Use image node_id 4 for calling the ASRTFRecordDatasetFactory obj's underlying member method code with example usage: obj._build(is_training, num_frames, stride, num_spec_frames, dataset_spec_mean, dataset_spec_stddev, num_test_clips, min_resize, crop_size, spec_compute_online, spec_shape, spec_augment, spec_augment_params, num_waveform_samples, waveform_stride, zero_centering_image, spec_from_wave_sample_rate, spec_from_wave_snr, spec_from_wave_add_gaussian_noise, spec_from_wave_add_masking_noise, spec_from_wave_visualness_threshold, spec_from_wave_random_mask_noise_rate, spec_from_wave_max_word_len, spec_from_wave_extend_mask_boundaries_ms, spec_from_wave_max_num_masks, spec_from_wave_add_word_mask, spec_from_wave_add_word_mask_info, spec_from_wave_eval_noise_types, spec_from_wave_environment_noise_path, spec_from_wave_eval_noise_configs, spectrogram_type, spec_frame_length, spec_frame_step, spec_num_features, spec_lower_edge_hertz, spec_upper_edge_hertz, max_num_words, max_num_captions, tokenizer, prepend_bos, append_eos, caption_string, masked_word_pred_aligned_caption_string, masked_word_pred_max_num_tokens, masked_word_pred_patch_size, masked_word_pred_max_num_masked_input_indices) and returns: duration_ok