(self, shared_outputs=None, accumulate_updates=False)
Allocate output buffer to store activations from fprop.

        Arguments:
            shared_outputs (Tensor, optional): pre-allocated tensor for activations to be
                                               computed into
Allocate output buffer to store activations from fprop.
Allocate output buffer to store activations from fprop .
def allocate(self, shared_outputs=None, accumulate_updates=False):
        """
        Allocate output buffer to store activations from fprop.

        Arguments:
            shared_outputs (Tensor, optional): pre-allocated tensor for activations to be
                                               computed into
        """
        # get the layers that own their outputs
        self.accumulate_updates = accumulate_updates
        alloc_layers = [l for l in self.layers if l.owns_output]
        if 'accumulate_updates' in inspect.getargspec(alloc_layers[-1].allocate).args:
            alloc_layers[-1].allocate(shared_outputs, accumulate_updates=accumulate_updates)
        else:
            alloc_layers[-1].allocate(shared_outputs)
        for l in self.layers:
            if 'accumulate_updates' in inspect.getargspec(l.allocate).args:
                l.allocate(accumulate_updates=accumulate_updates)
            else:
                l.allocate()
def allocate ( self , shared_outputs = None , accumulate_updates = False ) : # get the layers that own their outputs self . accumulate_updates = accumulate_updates alloc_layers = [ l for l in self . layers if l . owns_output ] if 'accumulate_updates' in inspect . getargspec ( alloc_layers [ - 1 ] . allocate ) . args : alloc_layers [ - 1 ] . allocate ( shared_outputs , accumulate_updates = accumulate_updates ) else : alloc_layers [ - 1 ] . allocate ( shared_outputs ) for l in self . layers : if 'accumulate_updates' in inspect . getargspec ( l . allocate ) . args : l . allocate ( accumulate_updates = accumulate_updates ) else : l . allocate ( )