def initialize_memmap_object(self, matrix_object: csr_matrix, path_memmap_object: str) -> memmap: fp = memmap(path_memmap_object, dtype='float64', mode='w+', shape=matrix_object.shape) fp[:] = matrix_object.todense()[:] return fp
def initialize_memmap_object(self, matrix_object:csr_matrix, path_memmap_object:str)->memmap: fp = memmap(path_memmap_object, dtype='float64', mode='w+', shape=matrix_object.shape) fp[:] = matrix_object.todense()[:] return fp
def matrix(self, matrix: csr_matrix): if matrix.size: self.__matrix = matrix.todense()