class_docstr: A class for Tensorflow specific optimizer logic.
  
  The major behavior change for this class is for tf.distribute.
  
  It will override methods from base Keras core Optimizer,
  which provide distribute specific functionality, e.g. variable
  creation, loss reduction, etc.
class_docstr_tok: ["A","class","for","Tensorflow","specific","optimizer","logic",".","The","major","behavior","change","for","this","class","is","for","tf.distribute",".","It","will","override","methods","from","base","Keras","core","Optimizer",",","which","provide","distribute","specific","functionality",",","e.g",".","variable","creation",",","loss","reduction",",","etc","."]
code: def _apply_weight_decay(self, variables):
      if self.weight_decay is None:
          return
  
      def distributed_apply_weight_decay(
          distribution, variables, **kwargs
      ):
          def weight_decay_fn(variable):
              if self._use_weight_decay(variable):
                  lr = tf.cast(self.learning_rate, variable.dtype)
                  wd = tf.cast(self.weight_decay, variable.dtype)
                  variable.assign_sub(variable * wd * lr)
  
          for variable in variables:
              if isinstance(variable, backend.Variable):
                  variable = variable.value  # Convert to tf.Variable
              distribution.extended.update(
                  variable, weight_decay_fn, group=False
              )
  
      tf.__internal__.distribute.interim.maybe_merge_call(
          distributed_apply_weight_decay,
          self._distribution_strategy,
          variables,
      )
  
file_path: keras/keras/backend/tensorflow/optimizer.py
imports: import tensorflow
  from keras import backend
  from keras.backend.common import KerasVariable
  from keras.optimizers import base_optimizer
label_desc: Use image node_id 7 for calling the TFOptimizer obj's underlying member method code with example usage: obj._apply_weight_decay(variables) without return types