def get_mem_gb_from_matrix_dim(nonzero_entries):
''' Estimate memory usage of loading a matrix. '''
matrix_mem_gb = round(np.ceil(1.0 * nonzero_entries / cr_constants.NUM_MATRIX_ENTRIES_PER_MEM_GB))
return cr_constants.MATRIX_MEM_GB_MULTIPLIER * max(cr_constants.MIN_MEM_GB, matrix_mem_gb)
评论列表
文章目录