[CI/Build] Avoid CUDA initialization (#8534)
This commit is contained in:
@@ -6,10 +6,10 @@ from .interface import Platform, PlatformEnum
|
||||
class CpuPlatform(Platform):
|
||||
_enum = PlatformEnum.CPU
|
||||
|
||||
@staticmethod
|
||||
def get_device_name(device_id: int = 0) -> str:
|
||||
@classmethod
|
||||
def get_device_name(cls, device_id: int = 0) -> str:
|
||||
return "cpu"
|
||||
|
||||
@staticmethod
|
||||
def inference_mode():
|
||||
@classmethod
|
||||
def inference_mode(cls):
|
||||
return torch.no_grad()
|
||||
|
||||
Reference in New Issue
Block a user