aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/predictor
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-08-01 08:40:38 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-01 08:44:28 -0700
commit338df0b07d8c7e99d93cad4e171ac23c3cf3d696 (patch)
treed14692c31056558a4855eb311d28ae547db5f326 /tensorflow/contrib/predictor
parent25567a1204f78a8d48d17edc45828db170162001 (diff)
Add `{input, output}_names` to `predictor.from_saved_model`. This exposes existing functionality via factory methods.
PiperOrigin-RevId: 206934272
Diffstat (limited to 'tensorflow/contrib/predictor')
-rw-r--r--tensorflow/contrib/predictor/predictor_factories.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tensorflow/contrib/predictor/predictor_factories.py b/tensorflow/contrib/predictor/predictor_factories.py
index f275bc15ad..7886744b3c 100644
--- a/tensorflow/contrib/predictor/predictor_factories.py
+++ b/tensorflow/contrib/predictor/predictor_factories.py
@@ -108,6 +108,8 @@ def from_estimator(estimator,
def from_saved_model(export_dir,
signature_def_key=None,
signature_def=None,
+ input_names=None,
+ output_names=None,
tags=None,
graph=None,
config=None):
@@ -121,6 +123,12 @@ def from_saved_model(export_dir,
signature_def: A `SignatureDef` proto specifying the inputs and outputs
for prediction. Only one of `signature_def_key` and `signature_def`
should be specified.
+ input_names: A dictionary mapping strings to `Tensor`s in the `SavedModel`
+ that represent the input. The keys can be any string of the user's
+ choosing.
+ output_names: A dictionary mapping strings to `Tensor`s in the
+ `SavedModel` that represent the output. The keys can be any string of
+ the user's choosing.
tags: Optional. Tags that will be used to retrieve the correct
`SignatureDef`. Defaults to `DEFAULT_TAGS`.
graph: Optional. The Tensorflow `graph` in which prediction should be
@@ -138,6 +146,8 @@ def from_saved_model(export_dir,
export_dir,
signature_def_key=signature_def_key,
signature_def=signature_def,
+ input_names=input_names,
+ output_names=output_names,
tags=tags,
graph=graph,
config=config)