aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/estimator
diff options
context:
space:
mode:
authorGravatar Rohan Jain <rohanj@google.com>2018-09-26 22:00:22 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-09-26 22:03:37 -0700
commita40cfd42e20d7e4520c1306666c9dfee97eb0a2e (patch)
tree380100ade305a7b1fe8e7baa7eed2197daf1eabb /tensorflow/contrib/estimator
parent941e757a2364bb2e7cf41b8d980d7639849c6c5d (diff)
Automated rollback of commit e00d7744dbab5c73e4d8ffa8a7d361f7b2dcefff
PiperOrigin-RevId: 214721004
Diffstat (limited to 'tensorflow/contrib/estimator')
-rw-r--r--tensorflow/contrib/estimator/python/estimator/dnn_with_layer_annotations.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/tensorflow/contrib/estimator/python/estimator/dnn_with_layer_annotations.py b/tensorflow/contrib/estimator/python/estimator/dnn_with_layer_annotations.py
index 3fd9f12c61..5faf0aacfe 100644
--- a/tensorflow/contrib/estimator/python/estimator/dnn_with_layer_annotations.py
+++ b/tensorflow/contrib/estimator/python/estimator/dnn_with_layer_annotations.py
@@ -75,7 +75,9 @@ def make_input_layer_with_layer_annotations(original_input_layer):
weight_collections=None,
trainable=True,
cols_to_vars=None,
- cols_to_output_tensors=None):
+ scope=None,
+ cols_to_output_tensors=None,
+ from_template=False):
"""Returns a dense `Tensor` as input layer based on given `feature_columns`.
Generally a single example in training data is described with
@@ -111,9 +113,12 @@ def make_input_layer_with_layer_annotations(original_input_layer):
'some_variable:0' shape=(5, 10), <tf.Variable 'some_variable:1'
shape=(5, 10)]} If a column creates no variables, its value will be an
empty list.
+ scope: A name or variable scope to use
cols_to_output_tensors: If not `None`, must be a dictionary that will be
filled with a mapping from '_FeatureColumn' to the associated output
`Tensor`s.
+ from_template: True if the method is being instantiated from a
+ `make_template`.
Returns:
A `Tensor` which represents input layer of a model. Its shape
@@ -131,7 +136,9 @@ def make_input_layer_with_layer_annotations(original_input_layer):
weight_collections=weight_collections,
trainable=trainable,
cols_to_vars=cols_to_vars,
- cols_to_output_tensors=local_cols_to_output_tensors)
+ scope=scope,
+ cols_to_output_tensors=local_cols_to_output_tensors,
+ from_template=from_template)
if cols_to_output_tensors is not None:
cols_to_output_tensors = local_cols_to_output_tensors
@@ -296,9 +303,9 @@ def DNNClassifierWithLayerAnnotations( # pylint: disable=invalid-name
def _model_fn(features, labels, mode, config):
with _monkey_patch(
- feature_column_lib, 'input_layer',
+ feature_column_lib, '_internal_input_layer',
make_input_layer_with_layer_annotations(
- feature_column_lib.input_layer)):
+ feature_column_lib._internal_input_layer)): # pylint: disable=protected-access
return original.model_fn(features, labels, mode, config)
return estimator.Estimator(
@@ -417,9 +424,9 @@ def DNNRegressorWithLayerAnnotations( # pylint: disable=invalid-name
def _model_fn(features, labels, mode, config):
with _monkey_patch(
- feature_column_lib, 'input_layer',
+ feature_column_lib, '_internal_input_layer',
make_input_layer_with_layer_annotations(
- feature_column_lib.input_layer)):
+ feature_column_lib._internal_input_layer)): # pylint: disable=protected-access
return original.model_fn(features, labels, mode, config)
return estimator.Estimator(