parameters: (self, diffs=None, **kwargs)
return_statement: return outs
docstring: Backward pass: prepare diffs and run the net backward.
  
      Take
      diffs: list of diffs to return in addition to bottom diffs.
      kwargs: Keys are output blob names and values are diff ndarrays.
              If None, top diffs are taken from forward loss.
  
      Give
      outs: {blob name: diff ndarray} dict.
docstring_summary: Backward pass: prepare diffs and run the net backward.
docstring_tokens: Backward pass : prepare diffs and run the net backward .
function: def _Net_backward(self, diffs=None, **kwargs):
      """
      Backward pass: prepare diffs and run the net backward.
  
      Take
      diffs: list of diffs to return in addition to bottom diffs.
      kwargs: Keys are output blob names and values are diff ndarrays.
              If None, top diffs are taken from forward loss.
  
      Give
      outs: {blob name: diff ndarray} dict.
      """
      if diffs is None:
          diffs = []
  
      if kwargs:
          if set(kwargs.keys()) != set(self.outputs):
              raise Exception('Top diff arguments do not match net outputs.')
          # Set top diffs according to defined shapes and make arrays single and
          # C-contiguous as Caffe expects.
          for top, diff in kwargs.iteritems():
              if diff.shape[0] != self.blobs[top].num:
                  raise Exception('Diff is not batch sized')
              if diff.ndim != 4:
                  raise Exception('{} diff is not 4-d'.format(top))
              self.blobs[top].diff[...] = diff
  
      self._backward()
  
      # Unpack diffs to extract
      outs = {out: self.blobs[out].diff for out in set(self.inputs + diffs)}
      return outs
function_tokens: def _Net_backward ( self , diffs = None , * * kwargs ) : if diffs is None : diffs = [ ] if kwargs : if set ( kwargs . keys ( ) ) != set ( self . outputs ) : raise Exception ( 'Top diff arguments do not match net outputs.' ) # Set top diffs according to defined shapes and make arrays single and # C-contiguous as Caffe expects. for top , diff in kwargs . iteritems ( ) : if diff . shape [ 0 ] != self . blobs [ top ] . num : raise Exception ( 'Diff is not batch sized' ) if diff . ndim != 4 : raise Exception ( '{} diff is not 4-d' . format ( top ) ) self . blobs [ top ] . diff [ ... ] = diff self . _backward ( ) # Unpack diffs to extract outs = { out : self . blobs [ out ] . diff for out in set ( self . inputs + diffs ) } return outs