dora/active_sampling/utils.py
def append(self, value):
        """
        Add an array_like to the buffer.

        This extending its first axis by adding a (1 x value.shape) row
        onto the end.

        Parameters
        ----------
        value : array_like
            A one dimensional array of length dims consistent with the buffer.
        """
        value = np.asarray(value)

        if self.__buffer is None:
            newsize = (ArrayBuffer.initial_size,) + value.shape  # tuples
            self.__buffer = np.zeros(newsize, value.dtype)

        assert(value.ndim == self.__buffer.ndim - 1)
        assert(value.shape == self.__buffer.shape[1:])

        self.__count += 1

        if self.__count >= self.__buffer.shape[0]:
            growth_factor = 2.0
            newsize = list(self.__buffer.shape)
            newsize[0] = int(np.floor(growth_factor * newsize[0] + 2.0))
            self.__buffer = np.resize(self.__buffer, newsize)

        self.__buffer[self.__count - 1] = value
        self.__value = self.__buffer[:self.__count]

        Add an array_like to the buffer.

        This extending its first axis by adding a (1 x value.shape) row
        onto the end.

        Parameters
        ----------
        value : array_like
            A one dimensional array of length dims consistent with the buffer.
        
Add an array_like to the buffer.
This extending its first axis by adding a (1 x value.shape) row
onto the end.

Parameters

value : array_like
A one dimensional array of length dims consistent with the buffer.
Add an array_like to the buffer . This extending its first axis by adding a ( 1 x value . shape ) row onto the end . Parameters value : array_like A one dimensional array of length dims consistent with the buffer .
def append(self, value):
        value = np.asarray(value)
        if self.__buffer is None:
            newsize = (ArrayBuffer.initial_size,) + value.shape  
            self.__buffer = np.zeros(newsize, value.dtype)
        assert(value.ndim == self.__buffer.ndim - 1)
        assert(value.shape == self.__buffer.shape[1:])
        self.__count += 1
        if self.__count >= self.__buffer.shape[0]:
            growth_factor = 2.0
            newsize = list(self.__buffer.shape)
            newsize[0] = int(np.floor(growth_factor * newsize[0] + 2.0))
            self.__buffer = np.resize(self.__buffer, newsize)
        self.__buffer[self.__count - 1] = value
        self.__value = self.__buffer[:self.__count]
def append ( self , value ) : value = np . asarray ( value ) if self . __buffer is None : newsize = ( ArrayBuffer . initial_size , ) + value . shape self . __buffer = np . zeros ( newsize , value . dtype ) assert ( value . ndim == self . __buffer . ndim - 1 ) assert ( value . shape == self . __buffer . shape [ 1 : ] ) self . __count += 1 if self . __count >= self . __buffer . shape [ 0 ] : growth_factor = 2.0 newsize = list ( self . __buffer . shape ) newsize [ 0 ] = int ( np . floor ( growth_factor * newsize [ 0 ] + 2.0 ) ) self . __buffer = np . resize ( self . __buffer , newsize ) self . __buffer [ self . __count - 1 ] = value self . __value = self . __buffer [ : self . __count ]
Add an array_like to the buffer.
Add an array_like to the buffer .
"""
        Add an array_like to the buffer.

        This extending its first axis by adding a (1 x value.shape) row
        onto the end.

        Parameters
        ----------
        value : array_like
            A one dimensional array of length dims consistent with the buffer.
        """ # tuples
self
value