MCPcopy Create free account
hub / github.com/RL-Align/RL-Kernel / _select_device

Function _select_device

scripts/check_operator.py:38–44  ·  view source on GitHub ↗
(value: str)

Source from the content-addressed store, hash-verified

36
37
38def _npu_available() -> bool:
39 """torch.npu only exists after torch_npu is imported; probe defensively."""
40 try:
41 import torch_npu # noqa: F401
42 except ImportError:
43 return False
44 return hasattr(torch, "npu") and torch.npu.is_available()
45
46
47def _select_device(value: str) -> torch.device:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected