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 _var_key(self, variable):
      if isinstance(variable, backend.Variable):
          variable = variable.value  # Convert to tf.Variable
      if hasattr(variable, "_distributed_container"):
          variable = variable._distributed_container()
      elif (
          isinstance(variable, tf.__internal__.CompositeTensor)
          and hasattr(variable, "handle")
          and hasattr(variable.handle, "_distributed_container")
      ):
          # For ResourceVariables, the _distributed_container attribute
          # is added to their handle tensors.
          variable = variable.handle._distributed_container()
      return variable._unique_id
  
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 6 for calling the TFOptimizer obj's underlying member method code with example usage: obj._var_key(variable) and returns: variable