提交 26f2a3cb 编写于 作者: T Tao Luo 提交者: GitHub

Merge pull request #1775 from luotao1/infer

support multi-field for inference
......@@ -37,8 +37,13 @@ class Inference(object):
self.__gradient_machine__.finish()
def iter_infer_field(self, field, **kwargs):
if not isinstance(field, list) and not isinstance(field, tuple):
field = [field]
for result in self.iter_infer(**kwargs):
yield [each_result[field] for each_result in result]
for each_result in result:
item = [each_result[each_field] for each_field in field]
yield item
def infer(self, field='value', **kwargs):
retv = None
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册