(self, t)
return tuple(self.outputs.values())
Converts Aeon data to tuple of tensors.

        Arguments:
            t (tuple): Tuple of numpy arrays.
                For example: {tuple}{'image':ndarray(...), 'label':ndarray(...)}
                where 'image' shape is (N,C,H,W) and 'label' shape is (N,1)
Converts Aeon data to tuple of tensors.
Converts Aeon data to tuple of tensors .
def transform(self, t):
        """
        Converts Aeon data to tuple of tensors.

        Arguments:
            t (tuple): Tuple of numpy arrays.
                For example: {tuple}{'image':ndarray(...), 'label':ndarray(...)}
                where 'image' shape is (N,C,H,W) and 'label' shape is (N,1)
        """
        for key, value in t:
            assert value.shape[0] == self.be.bsz

            reshape_rows = self.be.bsz

            # Convert audio length from absolute to percentage
            if key == 'audio_length':
                for x in np.nditer(value, op_flags=['readwrite']):
                    x[...] = x/self.max_duration*100
                value = value.astype(np.uint8, copy=False)

            if key == 'char_map':
                x = value
                x = x[x != 0]
                x = np.reshape(x, (1, -1))
                x = np.ascontiguousarray(x)  # Contigious array needed for GPU backend
            else:
                # Adjust Aeon data layout to Neon layout, e.g. shape (N,C,H,W) -> (N,C*H*W)
                x = np.reshape(value, (reshape_rows, -1))
                x = np.ascontiguousarray(x.T)  # Contigious array needed for GPU backend

            # Patch that forces the numpy array into C order to fix the strides for NumPy > 1.11.1
            x = np.array(x, order='C')

            # Create tensor
            self.outputs[key] = self.be.array(x, dtype=value.dtype)

        return tuple(self.outputs.values())
def transform ( self , t ) : for key , value in t : assert value . shape [ 0 ] == self . be . bsz reshape_rows = self . be . bsz # Convert audio length from absolute to percentage if key == 'audio_length' : for x in np . nditer ( value , op_flags = [ 'readwrite' ] ) : x [ ... ] = x / self . max_duration * 100 value = value . astype ( np . uint8 , copy = False ) if key == 'char_map' : x = value x = x [ x != 0 ] x = np . reshape ( x , ( 1 , - 1 ) ) x = np . ascontiguousarray ( x ) # Contigious array needed for GPU backend else : # Adjust Aeon data layout to Neon layout, e.g. shape (N,C,H,W) -> (N,C*H*W) x = np . reshape ( value , ( reshape_rows , - 1 ) ) x = np . ascontiguousarray ( x . T ) # Contigious array needed for GPU backend # Patch that forces the numpy array into C order to fix the strides for NumPy > 1.11.1 x = np . array ( x , order = 'C' ) # Create tensor self . outputs [ key ] = self . be . array ( x , dtype = value . dtype ) return tuple ( self . outputs . values ( ) )