We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents df5a95d + cadabe1 commit 26f2a3cCopy full SHA for 26f2a3c
python/paddle/v2/inference.py
@@ -37,8 +37,13 @@ def __reader_impl__():
37
self.__gradient_machine__.finish()
38
39
def iter_infer_field(self, field, **kwargs):
40
+ if not isinstance(field, list) and not isinstance(field, tuple):
41
+ field = [field]
42
+
43
for result in self.iter_infer(**kwargs):
- yield [each_result[field] for each_result in result]
44
+ for each_result in result:
45
+ item = [each_result[each_field] for each_field in field]
46
+ yield item
47
48
def infer(self, field='value', **kwargs):
49
retv = None
0 commit comments