-
Couldn't load subscription status.
- Fork 5.9k
Closed
Description
related to issue #2107 In paddle.infer, it concatenate different output of the same field as follow:
def infer(self, input, field='value', **kwargs): """ Infer a data by model. :param input: input data batch. Should be python iterable object. :param field: output field. """ retv = None kwargs['input'] = input for result in self.iter_infer_field(field=field, **kwargs): if retv is None: retv = [[] for i in xrange(len(result))] for i, item in enumerate(result): retv[i].append(item) > retv = [numpy.concatenate(out) for out in retv] if len(retv) == 1: return retv[0] else: return retvWhy you need to concatenate it ? Can it be done with a 2 d list or a list of dictionary ? So that you don't need to require the shape of each output to be exactly the same ?
Metadata
Metadata
Assignees
Labels
No labels