class_docstr: Conditional optimizer.
class_docstr_tok: ["Conditional","optimizer","."]
code: def apply_gradients(
      self, grads_and_vars, global_step=None, name=None
  ):
      if contrib.is_tf2:
          with tf.control_dependencies(
              [tf.assign_add(tf.train.get_or_create_global_step(), 1)]
          ):
              return self._opt.apply_gradients(
                  grads_and_vars, name=name
              )
      else:
          return self._opt.apply_gradients(
              grads_and_vars, global_step=global_step, name=name
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import adafactor
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import misc_utils
  from tensor2tensor.utils import mlperf_log
  from tensor2tensor.utils import multistep_optimizer
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import yellowfin
  import tensorflow.compat.v1
  from tensorflow.python.framework import dtypes
label_desc: Use image node_id 3 for calling the ConditionalOptimizer obj's underlying member method code with example usage: obj.apply_gradients(grads_and_vars, global_step, name) and returns: self, self