'bprop through layers, saving hidden_error for Recurrent layers'

def bprop(self, error, inference=False, alpha=1.0, beta=0.0):

    hidden_error_list = []
    for l in reversed(self.layers):
        altered_tensor = l.be.distribute_data(error, l.parallelism)
        if altered_tensor:
            l.revert_list.append(altered_tensor)
        error = l.bprop(error)
        if isinstance(l, Recurrent):
            hidden_error_list.append(l.get_final_hidden_error())
        for tensor in l.revert_list:
            self.be.revert_tensor(tensor)
    hidden_error_list.reverse()
    return hidden_error_list
