def METHOD_NAME():
  model_weights = model_variables_fn()
  optimizer = tff_optimizer_fn()
  model_weight_specs = tf.nest.map_structure(
      lambda v: tf.TensorSpec(v.shape, v.dtype), model_weights
  )
  state = optimizer.initialize(model_weight_specs)
  for grad in gradients:
    state, model_weights = optimizer.next(state, model_weights, grad)
  return model_weights