'Get outputs of the previous forward computation.
If begin or end is specified, return [begin, end)-th outputs,
otherwise return all outputs.
Parameters
merge_multi_context : bool
Default is `True`. In the case when data-parallelism is used, the outputs
will be collected from multiple devices. A `True` value indicate that we
should merge the collected results so that they look like from a single
executor.
begin : int
starting index of returned outputs in all outputs
end : int or None
ending index (excluded) of returned outputs.
Returns
If `merge_multi_context` is ``True``, it is like ``[out1, out2]``. Otherwise, it
is like ``[[out1_dev1, out1_dev2], [out2_dev1, out2_dev2]]``. All the output
elements are `NDArray`.'

def get_outputs(self, merge_multi_context=True, begin=0, end=None):

    if (end is None):
        end = self.num_outputs
    outputs = [[exec_.outputs[i] for exec_ in self.execs] for i in range(begin, end)]
    if merge_multi_context:
        outputs = _merge_multi_context(outputs, self.output_layouts)
    return outputs
