code: def add_white_noise(wave_tensor, snr):
      """Adds deterministic gaussian white noise to the signal.
  
      While setting a global seeds does not guarrantee the deterministic per-sample
      noise generation due to the intrinsic randomness in the TF dataloading
      process. Instead, we generate the seeds from the input signal and generate
      noise from the stateless normal sampling process. This effectively sample
      deterministic noise per sample while the noise varies between samples. (A
      constant seed for all sample would generate identical noise for all samples,
      which is not a desired behavior.)
  
      Args:
        wave_tensor: Input tensor containing the raw wave signal.
        snr: The signal to noise ratio to determine the power of the noise.
  
      Returns:
        Output signal with gaussian white noise injected.
      """
      pos = tf.reduce_mean(tf.square(wave_tensor))
      nos = pos / snr
      # Deterministically create the noise using the input signal as the seeds.
      # The seeds are determined by the sums of the positive and negative signals.
      positive_sum = tf.cast(
          tf.reduce_sum(tf.maximum(wave_tensor, 0)), tf.int32
      )
      negative_sum = tf.cast(
          tf.reduce_sum(tf.maximum(-wave_tensor, 0)), tf.int32
      )
      noise = tf.random.stateless_normal(
          tf.shape(wave_tensor),
          seed=[positive_sum, negative_sum],
          stddev=tf.sqrt(nos),
          dtype=wave_tensor.dtype,
      )
  
      return wave_tensor + noise
  
imports: import functools
  from typing import Any, Dict, Optional, Sequence
  from absl import logging
  from dmvr import builders
  from dmvr import processors
  from dmvr import tokenizers
  import numpy
  from scenic.projects.mbt.datasets.dataset_utils import _decode_spectrogram
  from scenic.projects.mbt.datasets.dataset_utils import apply_specaugment
  import tensorflow
label_desc: Use image node_id 3 for calling a global function with example usage: add_white_noise(wave_tensor, snr) and returns: unknown