Fixes stale tff.utils.get_variables in a notebook.
"@tff.tf_computation(MODEL_TYPE, BATCH_TYPE, tf.float32)\n",
"def batch_train(initial_model, batch, learning_rate):\n",
" # Define a group of model variables and set them to `initial_model`.\n",
- " model_vars = tff.utils.get_variables('v', MODEL_TYPE)\n",
+ " model_vars = tff.utils.create_variables('v', MODEL_TYPE)\n",
" init_model = tff.utils.assign(model_vars, initial_model)\n",
"\n",
" # Perform one step of gradient descent using loss from `batch_loss`.\n",
