#NEWLINE# def set_deltas( self , delta_buffers ) : #NEWLINE# #INDENT# '\n        Use pre-allocated (by layer containers) list of buffers for backpropagated error.\n        Only set deltas for layers that own their own deltas\n        Only allocate space if layer owns its own deltas (i.e. bias, activation work in-place,\n        so do not own their deltas).\n\n        Arguments:\n            delta_buffers (list): list of pre-allocated tensors (provided by layer container)\n\n        ' #NEWLINE# if ( ( self . next_layer is not None ) and ( self . next_layer . parallelism != self . parallelism ) ) : #NEWLINE# #INDENT# self . owns_delta = True #NEWLINE# #UNINDENT# if ( self . owns_delta and self . prev_layer ) : #NEWLINE# #INDENT# if ( type ( self . prev_layer ) in ( BranchNode , ColorNoise ) ) : #NEWLINE# #INDENT# self . deltas = self . prev_layer . deltas #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . deltas = self . be . iobuf ( self . in_shape , shared = delta_buffers [ 0 ] , parallelism = self . parallelism ) #NEWLINE# delta_buffers . reverse ( ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . deltas = None