Use proper device names instead of "xpu"

pull/19/head
Disty0 2023-06-02 01:37:39 +03:00
parent 8046b15445
commit 96f577d569
1 changed files with 1 additions and 1 deletions

View File

@ -172,7 +172,7 @@ def get_memory():
pass
else:
try:
s = [(torch.xpu.get_device_properties("xpu").total_memory - torch.xpu.memory_allocated()), torch.xpu.get_device_properties("xpu").total_memory]
s = [(torch.xpu.get_device_properties(shared.device).total_memory - torch.xpu.memory_allocated()), torch.xpu.get_device_properties(shared.device).total_memory]
gpu = { 'free': gb(s[0]), 'used': gb(s[1] - s[0]), 'total': gb(s[1]) }
s = dict(torch.xpu.memory_stats(shared.device))
allocated = { 'current': gb(s['allocated_bytes.all.current']), 'peak': gb(s['allocated_bytes.all.peak']) }