tf.estimator.export.TensorServingInputReceiver
Stay organized with collections
Save and categorize content based on your preferences.
A return type for a serving_input_receiver_fn.
tf.estimator.export.TensorServingInputReceiver(
features, receiver_tensors, receiver_tensors_alternatives=None
)
This is for use with models that expect a single Tensor
or SparseTensor
as an input feature, as opposed to a dict of features.
The normal ServingInputReceiver
always returns a feature dict, even if it
contains only one entry, and so can be used only with models that accept such
a dict. For models that accept only a single raw feature, the
serving_input_receiver_fn
provided to Estimator.export_saved_model()
should return this TensorServingInputReceiver
instead. See:
https://github.com/tensorflow/tensorflow/issues/11674
Note that the receiver_tensors and receiver_tensor_alternatives arguments
will be automatically converted to the dict representation in either case,
because the SavedModel format requires each input Tensor
to have a name
(provided by the dict key).
The expected return values are:
features: A single Tensor
or SparseTensor
, representing the feature
to be passed to the model.
receiver_tensors: A Tensor
, SparseTensor
, or dict of string to Tensor
or SparseTensor
, specifying input nodes where this receiver expects to
be fed by default. Typically, this is a single placeholder expecting
serialized tf.Example
protos.
receiver_tensors_alternatives: a dict of string to additional
groups of receiver tensors, each of which may be a Tensor
,
SparseTensor
, or dict of string to Tensor
orSparseTensor
.
These named receiver tensor alternatives generate additional serving
signatures, which may be used to feed inputs at different points within
the input receiver subgraph. A typical usage is to allow feeding raw
feature Tensor
s downstream of the tf.parse_example() op.
Defaults to None.
Attributes |
features
|
|
receiver_tensors
|
|
receiver_tensors_alternatives
|
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-10-01 UTC."],[],[],null,["# tf.estimator.export.TensorServingInputReceiver\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/estimator/export/TensorServingInputReceiver) | [View source on GitHub](https://github.com/tensorflow/estimator/tree/master/tensorflow_estimator/python/estimator/export/export.py) |\n\nA return type for a serving_input_receiver_fn.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.estimator.export.TensorServingInputReceiver`](/api_docs/python/tf/estimator/export/TensorServingInputReceiver)\n\n\u003cbr /\u003e\n\n tf.estimator.export.TensorServingInputReceiver(\n features, receiver_tensors, receiver_tensors_alternatives=None\n )\n\nThis is for use with models that expect a single `Tensor` or `SparseTensor`\nas an input feature, as opposed to a dict of features.\n\nThe normal `ServingInputReceiver` always returns a feature dict, even if it\ncontains only one entry, and so can be used only with models that accept such\na dict. For models that accept only a single raw feature, the\n`serving_input_receiver_fn` provided to [`Estimator.export_saved_model()`](../../../tf/compat/v1/estimator/Estimator#export_saved_model)\nshould return this `TensorServingInputReceiver` instead. See:\nhttps://github.com/tensorflow/tensorflow/issues/11674\n\nNote that the receiver_tensors and receiver_tensor_alternatives arguments\nwill be automatically converted to the dict representation in either case,\nbecause the SavedModel format requires each input `Tensor` to have a name\n(provided by the dict key).\n\nThe expected return values are:\nfeatures: A single `Tensor` or `SparseTensor`, representing the feature\nto be passed to the model.\nreceiver_tensors: A `Tensor`, `SparseTensor`, or dict of string to `Tensor`\nor `SparseTensor`, specifying input nodes where this receiver expects to\nbe fed by default. Typically, this is a single placeholder expecting\nserialized `tf.Example` protos.\nreceiver_tensors_alternatives: a dict of string to additional\ngroups of receiver tensors, each of which may be a `Tensor`,\n`SparseTensor`, or dict of string to `Tensor` or`SparseTensor`.\nThese named receiver tensor alternatives generate additional serving\nsignatures, which may be used to feed inputs at different points within\nthe input receiver subgraph. A typical usage is to allow feeding raw\nfeature `Tensor`s *downstream* of the tf.parse_example() op.\nDefaults to None.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|---------------------------------|---------------|\n| `features` | \u003cbr /\u003e \u003cbr /\u003e |\n| `receiver_tensors` | \u003cbr /\u003e \u003cbr /\u003e |\n| `receiver_tensors_alternatives` | \u003cbr /\u003e \u003cbr /\u003e |\n\n\u003cbr /\u003e"]]