MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / as_comp_node

Function as_comp_node

imperative/python/src/dlpack_convertor.cpp:82–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82CompNode as_comp_node(const std::string& name) {
83 thread_local struct {
84 std::string name;
85 CompNode cn;
86 } dlpack_cncached;
87 if (dlpack_cncached.name != name) {
88 dlpack_cncached.name = name;
89 dlpack_cncached.cn = CompNode::load(name);
90 }
91 return dlpack_cncached.cn;
92}
93
94CompNode mgb::imperative::get_tensor_device(const DLDevice& ctx, int stream) {
95 int id = ctx.device_id;

Callers 1

get_tensor_deviceMethod · 0.70

Calls 1

loadFunction · 0.70

Tested by

no test coverage detected