code: def adafactor_decay_rate_adam(beta2):
      """Second-moment decay rate like Adam, subsuming the correction factor.
  
      Args:
        beta2: a float between 0 and 1
      Returns:
        a scalar
      """
      t = tf.to_float(tf.train.get_or_create_global_step()) + 1.0
      decay = (
          beta2
          * (1.0 - tf.pow(beta2, t - 1.0))
          / (1.0 - tf.pow(beta2, t))
      )
      # decay = tf.cond(tf.equal(t, 1.0), lambda: beta2, lambda: decay)
      return decay
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import quantization
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling a global function with example usage: adafactor_decay_rate_adam(beta2) and returns: decay