code: def test_update_ops_for_optimizers(optimizer_class, kwargs):
      item = graph_item.GraphItem(graph=ops.Graph())
      with item.as_default():
          model = model_keras_dense_and_sparse()
          trainable_variables = model.trainable_variables
          kwargs = kwargs or {}
          optimizer = optimizer_class(**kwargs)
          print(optimizer)
          grads = optimizer.get_gradients(
              model.outputs[0], trainable_variables
          )
          optimizer.apply_gradients(zip(grads, trainable_variables))
          assert len(item.var_op_name_to_grad_info) == len(
              trainable_variables
          )
  
file_path: autodist/tests/test_graph_item.py
imports: import numpy
  import pytest
  import tensorflow
  from tensorflow.python import ops
  from tensorflow.python.keras.optimizer_v2 import adadelta
  from tensorflow.python.keras.optimizer_v2 import adagrad
  from tensorflow.python.keras.optimizer_v2 import adam
  from tensorflow.python.keras.optimizer_v2 import adamax
  from tensorflow.python.keras.optimizer_v2 import ftrl
  from tensorflow.python.keras.optimizer_v2 import gradient_descent
  from tensorflow.python.keras.optimizer_v2 import nadam
  from tensorflow.python.keras.optimizer_v2 import rmsprop
  from tensorflow.python.training.training_util import get_or_create_global_step
  from autodist import graph_item
  from autodist.kernel.common.op_info import UPDATE_OP_VAR_POS
label_desc: Use image node_id 3 for calling a global function with example usage: test_update_ops_for_optimizers(optimizer_class, kwargs) without return types