Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/MegEngine/MegEngine
/ as_device
Function
as_device
imperative/python/megengine/core/_wrap.py:46–49 ·
view source on GitHub ↗
(obj)
Source
from the content-addressed store, hash-verified
44
45
46
def
as_device(obj):
47
if
isinstance(obj, Device):
48
return
obj
49
return
Device(obj)
50
51
52
set_py_device_type(Device)
Callers
11
to
Method · 0.85
_make_const_for_backward
Method · 0.85
make_const
Method · 0.85
make_h2d
Method · 0.85
device
Method · 0.85
input_callback
Function · 0.85
__init__
Method · 0.85
get_value
Method · 0.85
concat
Function · 0.85
stack
Function · 0.85
copy
Function · 0.85
Calls
1
Device
Class · 0.70
Tested by
no test coverage detected