View source on GitHub |
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).