code: def test_sgd(self):
      with haiku.variables():
          params = [tf.Variable(1.0)]
          params = {p.ref(): tf.ones_like(p) for p in params}
  
      opt = sgd(learning_rate=0.01)
      opt_state = opt.init(params)
      grads = tree.map_structure(tf.ones_like, params)
      params, opt_state = opt.apply(opt_state, grads, params)
      (p,) = tree.flatten(params)
      self.assertAllClose(p.numpy(), 1.0 - (0.01 * 1))
  
file_path: sonnet/sonnet/src/functional/optimizers_test.py
imports: from absl.testing import parameterized
  import sonnet
  from sonnet.src import test_utils
  from sonnet.src.functional import haiku
  from sonnet.src.functional import optimizers
  import tensorflow
  import tree
label_desc: Use image node_id 1 for calling the OptimizersTest obj's underlying member method code with example usage: obj.test_sgd() without return types