code: def test_minimize_sparse_resource_variable_frobenius(dtype, device):
      if "gpu" in device and dtype == tf.float16:
          pytest.xfail(
              "See https://github.com/tensorflow/addons/issues/347"
          )
      var0 = tf.Variable([[1.0, 2.0]], dtype=dtype)
  
      def loss():
          x = tf.constant([[4.0], [5.0]], dtype=dtype)
          pred = tf.matmul(tf.nn.embedding_lookup([var0], [0]), x)
          return pred * pred
  
      # the gradient based on the current loss function
      grads0_0 = 32 * 1.0 + 40 * 2.0
      grads0_1 = 40 * 1.0 + 50 * 2.0
      grads0 = tf.constant([[grads0_0, grads0_1]], dtype=dtype)
      norm0 = tf.math.reduce_sum(grads0**2) ** 0.5
  
      learning_rate = 0.1
      lambda_ = 0.1
      ord = "fro"
      opt = cg_lib.ConditionalGradient(
          learning_rate=learning_rate, lambda_=lambda_, ord=ord
      )
      _ = opt.minimize(loss, var_list=[var0])
      test_utils.assert_allclose_according_to_type(
          [
              [
                  1.0 * learning_rate
                  - (1 - learning_rate) * lambda_ * grads0_0 / norm0,
                  2.0 * learning_rate
                  - (1 - learning_rate) * lambda_ * grads0_1 / norm0,
              ]
          ],
          var0.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 4 for calling a global function with example usage: test_minimize_sparse_resource_variable_frobenius(dtype, device) and returns: unknown