torch.xpu.memory.get_per_process_memory_fraction#
- torch.xpu.memory.get_per_process_memory_fraction(device=None)[source]#
- Retrieve the memory fraction currently set for a process on a given XPU device. This fraction represents the portion of the total device memory that the caching allocator is allowed to use. The allowed memory is calculated as: - Parameters
- device (torch.device or int or str, optional) – selected device. It uses the current device, given by - current_device(), if- deviceis- None(default).
- Returns
- The memory fraction in the range 0.0 to 1.0. 
- Return type