From 3e36e564fba2d8e22754a9c2aea458450ba492ca Mon Sep 17 00:00:00 2001 From: Luo Tao Date: Mon, 15 May 2017 13:24:45 +0800 Subject: [PATCH] add multiple outputs in annotation of paddle.infer --- python/paddle/v2/inference.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/python/paddle/v2/inference.py b/python/paddle/v2/inference.py index b4bb384969..2c1ae08f46 100644 --- a/python/paddle/v2/inference.py +++ b/python/paddle/v2/inference.py @@ -97,8 +97,22 @@ def infer(output_layer, parameters, input, feeding=None, field='value'): input=SomeData) print result + If there are multiple outout_layers and fields, the examples usages: + + .. code-block:: python + + result = paddle.infer(output_layer=[prediction1, prediction2], + parameters=parameters, + input=SomeData, + field=[id, value]]) + print result + + The result order is prediction1.id, prediction2.id, prediction1.value, + prediction2.value. + :param output_layer: output of the neural network that would be inferred - :type output_layer: paddle.v2.config_base.Layer + :type output_layer: paddle.v2.config_base.Layer or a list of + paddle.v2.config_base.Layer :param parameters: parameters of the neural network. :type parameters: paddle.v2.parameters.Parameters :param input: input data batch. Should be a python iterable object, and each -- GitLab