code: def test_optimizer_sparseadam():
      from bigdl.nano.tf.keras.layers import Embedding
      from bigdl.nano.tf.keras import Sequential
      import tensorflow as tf
  
      model = Sequential()
      model.add(Embedding(30, 16, input_length=5))
  
      sparse_optim = SparseAdam()
      model.compile(sparse_optim, "mse")
      input_array = np.array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]])
      output = model(input_array)
      labels = np.random.randint(30, size=output.shape)
  
      before_weights = model.get_weights()
      model.fit(input_array, labels, epochs=4, batch_size=2)
      after_weights = model.get_weights()
  
      # check if only the 0-10 cows of weights
      # have changed after training
      assert (
          before_weights[0][0:10, :] != after_weights[0][0:10, :]
      ).all()
      assert (
          before_weights[0][10:30, :] == after_weights[0][10:30, :]
      ).all()
  
label_desc: Use image node_id 1 for calling a global function with example usage: test_optimizer_sparseadam() without return types