code: def test_start_step():
      var0 = tf.Variable([1.0, 2.0])
      grads0 = tf.constant([0.1, 0.1])
      grads_and_vars = [(grads0, var0)]
  
      if hasattr(tf.keras.optimizers, "legacy"):
          sgd_opt = tf.keras.optimizers.legacy.SGD(lr=1.0)
      else:
          sgd_opt = tf.keras.optimizers.SGD(lr=1.0)
  
      opt = MovingAverage(sgd_opt, average_decay=0.5, start_step=1)
  
      opt.apply_gradients(grads_and_vars)
  
      np.testing.assert_allclose(var0.read_value(), [0.9, 1.9])
  
      ema_var0 = opt.get_slot(var0, "average")
  
      opt.apply_gradients(grads_and_vars)
  
      np.testing.assert_allclose(var0.read_value(), [0.8, 1.8])
  
      np.testing.assert_allclose(ema_var0.read_value(), [0.85, 1.85])
  
imports: import numpy
  import pytest
  import tensorflow
  from packaging.version import Version
  from tensorflow_addons.optimizers import MovingAverage
label_desc: Use image node_id 11 for calling a global function with example usage: test_start_step() without return types