清理cache。(属于内部调度接口,暂不支持对外功能。)
1 2 3 4
def clear_cache(self): del self.cache_pool torch.npu.empty_cache() gc.collect()