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

Function as_comp_node

imperative/python/src/tensor.cpp:449–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447}
448
449CompNode as_comp_node(const std::string& name) {
450 thread_local struct {
451 std::string name;
452 CompNode cn;
453 } cached;
454 if (cached.name != name) {
455 cached.name = name;
456 cached.cn = CompNode::load(name);
457 }
458 return cached.cn;
459}
460
461CompNode as_comp_node(py::object py_device) {
462 std::optional<std::string> device_name;

Callers 1

TensorWrapperMethod · 0.70

Calls 4

strFunction · 0.85
attrMethod · 0.80
loadFunction · 0.70
get_default_deviceFunction · 0.70

Tested by

no test coverage detected