MCPcopy 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
46def as_device(obj):
47 if isinstance(obj, Device):
48 return obj
49 return Device(obj)
50
51
52set_py_device_type(Device)

Callers 11

toMethod · 0.85
make_constMethod · 0.85
make_h2dMethod · 0.85
deviceMethod · 0.85
input_callbackFunction · 0.85
__init__Method · 0.85
get_valueMethod · 0.85
concatFunction · 0.85
stackFunction · 0.85
copyFunction · 0.85

Calls 1

DeviceClass · 0.70

Tested by

no test coverage detected