Rate this Page
โ˜… โ˜… โ˜… โ˜… โ˜…

torch.xpu.memory.empty_cache#

torch.xpu.memory.empty_cache()[source]#

Release all unoccupied cached memory currently held by the caching allocator so that those can be used in other XPU application.

Note

empty_cache() doesnโ€™t increase the amount of XPU memory available for PyTorch. However, it may help reduce fragmentation of XPU memory in certain cases.