[CI/Build] Add test decorator for minimum GPU memory (#8925)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import psutil
|
||||
import torch
|
||||
|
||||
from .interface import Platform, PlatformEnum
|
||||
@@ -10,6 +11,10 @@ class CpuPlatform(Platform):
|
||||
def get_device_name(cls, device_id: int = 0) -> str:
|
||||
return "cpu"
|
||||
|
||||
@classmethod
|
||||
def get_device_total_memory(cls, device_id: int = 0) -> int:
|
||||
return psutil.virtual_memory().total
|
||||
|
||||
@classmethod
|
||||
def inference_mode(cls):
|
||||
return torch.no_grad()
|
||||
|
||||
Reference in New Issue
Block a user