Shortcuts

torch.mps.empty_cache

torch.mps.empty_cache()[源代码]

释放缓存分配器当前持有的所有未占用的缓存内存,以便这些内存可以用于其他GPU应用程序。