def METHOD_NAME(proj_layer, opt):
  inputs1 = np_input1
  output1 = proj_layer.FPropDefaultTheta(inputs1, in_padding1)
  loss2_1 = tf.reduce_sum(output1)
  var_grads2_1 = py_utils.ComputeGradients(loss2_1, proj_layer.vars)
  grads2_1 = var_grads2_1.Transform(tuple)
  inputs1 = np_input2
  output1 = proj_layer.FPropDefaultTheta(inputs1, in_padding1)
  loss2_2 = tf.reduce_sum(output1)
  var_grads2_2 = py_utils.ComputeGradients(loss2_2, proj_layer.vars)
  grads2_2 = var_grads2_2.Transform(tuple)
  with cluster_factory.ForTestingWorker(add_summary=True):
    _ = opt.Apply(lr, var_grads2_1)
  # Get `snapshots` of the intermediate variables
  vars2_intermediate = [v.read_value() for v in proj_layer.vars.Flatten()]
  tf.assign_add(py_utils.GetOrCreateGlobalStepVar(), 1)
  with cluster_factory.ForTestingWorker(add_summary=True):
    _ = opt.Apply(lr, var_grads2_2)
  vars2_1 = proj_layer.vars.Flatten()
  return vars2_intermediate, vars2_1, grads2_1, grads2_2