From e26f9cddbd47b4139711c8a03871158943a989e5 Mon Sep 17 00:00:00 2001 From: Mustafa Ispir Date: Wed, 1 Feb 2017 13:57:20 -0800 Subject: Rename training_scaffold to scaffold. First step to use scaffold in all actions: training, evaluation, inference, serving. Change: 146285386 --- tensorflow/contrib/learn/python/learn/estimators/estimator.py | 2 +- .../contrib/learn/python/learn/estimators/estimator_test.py | 2 +- tensorflow/contrib/learn/python/learn/estimators/model_fn.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tensorflow/contrib/learn/python/learn/estimators/estimator.py b/tensorflow/contrib/learn/python/learn/estimators/estimator.py index ae4f0e857d..ebb3a5d378 100644 --- a/tensorflow/contrib/learn/python/learn/estimators/estimator.py +++ b/tensorflow/contrib/learn/python/learn/estimators/estimator.py @@ -934,7 +934,7 @@ class BaseEstimator( ]) all_hooks.extend(hooks) - scaffold = model_fn_ops.training_scaffold or monitored_session.Scaffold() + scaffold = model_fn_ops.scaffold or monitored_session.Scaffold() if not (scaffold.saver or ops.get_collection(ops.GraphKeys.SAVERS)): ops.add_to_collection( ops.GraphKeys.SAVERS, diff --git a/tensorflow/contrib/learn/python/learn/estimators/estimator_test.py b/tensorflow/contrib/learn/python/learn/estimators/estimator_test.py index 820d438d5b..99876281b5 100644 --- a/tensorflow/contrib/learn/python/learn/estimators/estimator_test.py +++ b/tensorflow/contrib/learn/python/learn/estimators/estimator_test.py @@ -368,7 +368,7 @@ class EstimatorTest(test.TestCase): predictions=constant_op.constant(0.), loss=constant_op.constant(0.), train_op=constant_op.constant(0.), - training_scaffold=monitored_session.Scaffold(init_fn=_init_fn)) + scaffold=monitored_session.Scaffold(init_fn=_init_fn)) est = estimator.Estimator(model_fn=_model_fn_scaffold) est.fit(input_fn=boston_input_fn, steps=1) diff --git a/tensorflow/contrib/learn/python/learn/estimators/model_fn.py b/tensorflow/contrib/learn/python/learn/estimators/model_fn.py index 1269e40be8..f6f0eeed58 100644 --- a/tensorflow/contrib/learn/python/learn/estimators/model_fn.py +++ b/tensorflow/contrib/learn/python/learn/estimators/model_fn.py @@ -51,7 +51,7 @@ class ModelFnOps( collections.namedtuple('ModelFnOps', [ 'predictions', 'loss', 'train_op', 'eval_metric_ops', 'output_alternatives', 'training_chief_hooks', 'training_hooks', - 'training_scaffold' + 'scaffold' ])): """Ops returned from a model_fn.""" @@ -64,7 +64,7 @@ class ModelFnOps( output_alternatives=None, training_chief_hooks=None, training_hooks=None, - training_scaffold=None): + scaffold=None): """Creates a validated `ModelFnOps` instance. For a multi-headed model, the predictions dict here will contain the outputs @@ -103,7 +103,7 @@ class ModelFnOps( run on the chief worker during training. training_hooks: A list of `SessionRunHook` objects that will be run on all workers during training. - training_scaffold: A `tf.train.Scaffold` object that can be used to set + scaffold: A `tf.train.Scaffold` object that can be used to set initialization, saver, and more to be used in training. Returns: @@ -176,4 +176,4 @@ class ModelFnOps( output_alternatives=output_alternatives, training_chief_hooks=training_chief_hooks, training_hooks=training_hooks, - training_scaffold=training_scaffold) + scaffold=scaffold) -- cgit v1.2.3