class_docstr: Optimizer that implements the Conditional Gradient optimization.
  
  This optimizer helps handle constraints well.
  
  Currently only supports frobenius norm constraint or nuclear norm
  constraint.
  See https://arxiv.org/pdf/1803.06453.pdf
  
  ```
  variable -= (1-learning_rate) * (variable + lambda_ * gradient
      / (frobenius_norm(gradient) + epsilon))
  ```
  
  Note that `lambda_` here refers to the constraint "lambda" in
  the paper. `epsilon` is constant with tiny value as compared to
  the value of frobenius norm of gradient. The purpose of `epsilon`
  here is to avoid the case that the value of frobenius norm of
  gradient is 0.
  
  In this implementation, `epsilon` defaults to $10^{-7}$.
  
  For nucler norm constraint, the formula is as following:
  
  ```
  variable -= (1-learning_rate) * (variable
      + lambda_ * top_singular_vector(gradient))
  ```
class_docstr_tok: ["Optimizer","that","implements","the","Conditional","Gradient","optimization",".","This","optimizer","helps","handle","constraints","well",".","Currently","only","supports","frobenius","norm","constraint","or","nuclear","norm","constraint",".","See","https",":","\/\/arxiv.org\/pdf\/1803.06453.pdf","``","`","variable","-=","(","1-learning_rate",")","*","(","variable","+","lambda_","*","gradient","\/","(","frobenius_norm","(","gradient",")","+","epsilon",")",")","``","`","Note","that","`","lambda_","`","here","refers","to","the","constraint","``","lambda","''","in","the","paper",".","`","epsilon","`","is","constant","with","tiny","value","as","compared","to","the","value","of","frobenius","norm","of","gradient",".","The","purpose","of","`","epsilon","`","here","is","to","avoid","the","case","that","the","value","of","frobenius","norm","of","gradient","is","0",".","In","this","implementation",",","`","epsilon","`","defaults","to","$","10^","{","-7","}","$",".","For","nucler","norm","constraint",",","the","formula","is","as","following",":","``","`","variable","-=","(","1-learning_rate",")","*","(","variable","+","lambda_","*","top_singular_vector","(","gradient",")",")","``","`"]
code: def _prepare_local(self, var_device, var_dtype, apply_state):
      super()._prepare_local(var_device, var_dtype, apply_state)
      apply_state[(var_device, var_dtype)][
          "learning_rate"
      ] = tf.identity(self._get_hyper("learning_rate", var_dtype))
      apply_state[(var_device, var_dtype)]["lambda_"] = tf.identity(
          self._get_hyper("lambda_", var_dtype)
      )
      apply_state[(var_device, var_dtype)][
          "epsilon"
      ] = tf.convert_to_tensor(self.epsilon, var_dtype)
  
file_path: addons/tensorflow_addons/optimizers/conditional_gradient.py
imports: import tensorflow
  from tensorflow_addons.optimizers import KerasLegacyOptimizer
  from tensorflow_addons.utils.types import FloatTensorLike
  from typeguard import typechecked
  from typing import Union, Callable
label_desc: Use image node_id 4 for calling the ConditionalGradient obj's underlying member method code with example usage: obj._prepare_local(var_device, var_dtype, apply_state) without return types