diff options
author | 2017-03-07 16:29:44 -0800 | |
---|---|---|
committer | 2017-03-07 16:48:17 -0800 | |
commit | b69dd297e19af8514ac46c9e85a916c838222dbb (patch) | |
tree | 123ada26ef29c12a0ed70562da0846c0aa2e99ba /tensorflow/python/estimator/model_fn.py | |
parent | 78756dcc25eb1224c12f78fe5adf79718c53683c (diff) |
EstimatorSpec: Define default scaffold in case of None provided. This will reduce the clutter in the usage of EstimatorSpec. Forexample, We can check scaffold.saver instead of if scaffold and scaffold.saver...
Change: 149482422
Diffstat (limited to 'tensorflow/python/estimator/model_fn.py')
-rw-r--r-- | tensorflow/python/estimator/model_fn.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/python/estimator/model_fn.py b/tensorflow/python/estimator/model_fn.py index 374ec6c8ca..a8936894ee 100644 --- a/tensorflow/python/estimator/model_fn.py +++ b/tensorflow/python/estimator/model_fn.py @@ -244,9 +244,9 @@ class EstimatorSpec( 'All hooks must be SessionRunHook instances, given: {}'.format( hook)) + scaffold = scaffold or monitored_session.Scaffold() # Validate scaffold. - if (scaffold is not None and - not isinstance(scaffold, monitored_session.Scaffold)): + if not isinstance(scaffold, monitored_session.Scaffold): raise TypeError( 'scaffold must be tf.train.Scaffold. Given: {}'.format(scaffold)) |