code: def test_sharing_frobenius(dtype):
      var0 = tf.Variable([1.0, 2.0], dtype=dtype)
      var1 = tf.Variable([3.0, 4.0], dtype=dtype)
      grads0 = tf.constant([0.1, 0.1], dtype=dtype)
      grads1 = tf.constant([0.01, 0.01], dtype=dtype)
      norm0 = tf.math.reduce_sum(grads0**2) ** 0.5
      norm1 = tf.math.reduce_sum(grads1**2) ** 0.5
      learning_rate = 0.1
      lambda_ = 0.1
      ord = "fro"
      cg_opt = cg_lib.ConditionalGradient(
          learning_rate=learning_rate, lambda_=lambda_, ord=ord
      )
      _ = cg_opt.apply_gradients(zip([grads0, grads1], [var0, var1]))
  
      # Check we have slots
      assert ["conditional_gradient"] == cg_opt.get_slot_names()
      slot0 = cg_opt.get_slot(var0, "conditional_gradient")
      assert slot0.get_shape() == var0.get_shape()
      slot1 = cg_opt.get_slot(var1, "conditional_gradient")
      assert slot1.get_shape() == var1.get_shape()
  
      # Because in the eager mode, as we declare two cg_update
      # variables, it already altomatically finish executing them.
      # Thus, we cannot test the param value at this time for
      # eager mode. We can only test the final value of param
      # after the second execution.
  
      # Step 2: the second conditional_gradient contain
      # the previous update.
      # Check that the parameters have been updated.
      cg_opt.apply_gradients(zip([grads0, grads1], [var0, var1]))
      test_utils.assert_allclose_according_to_type(
          np.array(
              [
                  (
                      1.0 * learning_rate
                      - (1 - learning_rate) * lambda_ * 0.1 / norm0
                  )
                  * learning_rate
                  - (1 - learning_rate) * lambda_ * 0.1 / norm0,
                  (
                      2.0 * learning_rate
                      - (1 - learning_rate) * lambda_ * 0.1 / norm0
                  )
                  * learning_rate
                  - (1 - learning_rate) * lambda_ * 0.1 / norm0,
              ]
          ),
          var0.numpy(),
      )
      test_utils.assert_allclose_according_to_type(
          np.array(
              [
                  (
                      3.0 * learning_rate
                      - (1 - learning_rate) * lambda_ * 0.01 / norm1
                  )
                  * learning_rate
                  - (1 - learning_rate) * lambda_ * 0.01 / norm1,
                  (
                      4.0 * learning_rate
                      - (1 - learning_rate) * lambda_ * 0.01 / norm1
                  )
                  * learning_rate
                  - (1 - learning_rate) * lambda_ * 0.01 / norm1,
              ]
          ),
          var1.numpy(),
      )
  
imports: import numpy
  import pytest
  import platform
  import tensorflow
  from tensorflow_addons.utils import test_utils
  from tensorflow_addons.optimizers import conditional_gradient
label_desc: Use image node_id 17 for calling a global function with example usage: test_sharing_frobenius(dtype) without return types