code: def testResourceVariables(self):
      v1 = tf.Variable([1.0, 2.0], use_resource=True)
      v2 = tf.Variable([3.0, 4.0], use_resource=True)
      with tf.GradientTape() as tape:
          tape.watch([v1, v2])
          loss = tf.reduce_sum(tf.gather(params=v1, indices=[0]) + v2)
      v1_grad, v2_grad = tape.gradient(loss, [v1, v2])
      multistep_opt = (
          multistep_with_adamoptimizer.MultistepAdamOptimizer(0.1)
      )
      multistep_opt.apply_gradients(((v1_grad, v1), (v2_grad, v2)))
  
file_path: tensor2tensor/tensor2tensor/utils/multistep_with_adamoptimizer_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensor2tensor.utils import multistep_with_adamoptimizer
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the MultistepAdamOptimizerTest obj's underlying member method code with example usage: obj.testResourceVariables() without return types