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

Method fetch_value

imperative/src/impl/physical_tensor.cpp:716–723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

714}
715
716void Tensor::fetch_value() {
717 MGB_LOCK_GUARD(m_value_mtx);
718 if (m_value.empty()) {
719 m_value.copy_from(dev_tensor(false));
720 m_value_ready.reset(EventPool::without_timer().alloc(comp_node()));
721 m_value_ready->record();
722 }
723}
724
725bool Tensor::value_fetched() {
726 MGB_LOCK_GUARD(m_value_mtx);

Callers 1

process_one_taskMethod · 0.80

Calls 6

comp_nodeFunction · 0.85
emptyMethod · 0.45
copy_fromMethod · 0.45
resetMethod · 0.45
allocMethod · 0.45
recordMethod · 0.45

Tested by

no test coverage detected