code: def noise_from_step_num():
      """Quantization noise equal to (phi * (step_num + 1)) mod 1.0.
  
      Not using random_uniform here due to a problem on TPU in that random seeds
      are not respected, which may cause the parameters on different replicas
      to go out-of-sync.
  
      Returns:
        a float32 scalar
      """
      step = tf.to_int32(tf.train.get_or_create_global_step()) + 1
      phi = ((5**0.5) - 1) / 2
      # Naive computation tf.mod(phi * step, 1.0) in float32 would be disastrous
      # due to loss of precision when the step number gets large.
      # Computation in doubles does not work on TPU, so we use this complicated
      # alternative computation which does not suffer from these roundoff errors.
      ret = 0.0
      for i in range(30):
          ret += (
              (phi * (2**i)) % 1.0
          ) * tf.to_float(  # double-precision computation in python
              tf.mod(step // (2**i), 2)
          )
      return tf.mod(ret, 1.0)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow.compat.v1
  from tensorflow.python.framework import function
label_desc: Use image node_id 4 for calling a global function with example usage: noise_from_step_num() and returns: tf