'Run backward on all devices. A backward should be called after
a call to the forward function. Backward cannot be called unless
``self.for_training`` is ``True``.
Parameters
out_grads : NDArray or list of NDArray, optional
Gradient on the outputs to be propagated back.
This parameter is only needed when bind is called
on outputs that are not a loss function.'

def backward(self, out_grads=None):

    assert self.for_training, 're-bind    with    for_training=True    to    run    backward'
    if (out_grads is None):
        out_grads = []
    for (i, (exec_, islice)) in enumerate(zip(self.execs, self.slices)):
        out_grads_slice = []
        for (grad, axis) in zip(out_grads, self.output_layouts):
            if (axis >= 0):
                og_my_slice = nd.slice_axis(grad, axis=axis, begin=islice.start, end=islice.stop)
                out_grads_slice.append(og_my_slice.as_in_context(self.contexts[i]))
            else:
                out_grads_slice.append(grad.copyto(self.contexts[i]))
        exec_.backward(out_grads=out_grads_slice)
