Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Topdu/OpenOCR
/ check_gpu
Function
check_gpu
tools/infer/utility.py:228–232 ·
view source on GitHub ↗
(use_gpu)
Source
from the content-addressed store, hash-verified
226
227
228
def
check_gpu(use_gpu):
229
import
torch
230
if
use_gpu and not torch.cuda.is_available():
231
use_gpu = False
232
return
use_gpu
233
234
235
if
__name__ ==
'__main__'
:
Callers
1
main
Function · 0.90
Calls
no outgoing calls
Tested by
no test coverage detected