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

Method get_device

imperative/src/impl/interpreter/interpreter_impl.cpp:538–549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

536}
537
538CompNode ChannelImpl::get_device(Handle handle) {
539 MGB_LOCK_GUARD(m_spin);
540 assert_available();
541 mgb_assert(
542 m_valid_handle.find(handle) != m_valid_handle.end(), "invalid handle: %p",
543 handle);
544 auto info = reinterpret_cast<TensorInfo*>(handle);
545 MGB_RECORD_EVENT(TensorGetPropEvent, info->id, TensorProp::Device);
546 auto ret = info->desc.comp_node;
547 mgb_assert(ret.valid());
548 return ret;
549}
550
551DeviceTensorND ChannelImpl::get_dev_tensor(Handle handle) {
552 MGB_LOCK_GUARD(m_spin);

Callers 1

comp_nodeMethod · 0.80

Calls 3

findMethod · 0.45
endMethod · 0.45
validMethod · 0.45

Tested by

no test coverage detected