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

Method try_get_value

imperative/src/impl/physical_tensor.cpp:738–744  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

736}
737
738const HostTensorND* Tensor::try_get_value() {
739 MGB_LOCK_GUARD(m_value_mtx);
740 if (!m_value.empty() && (!m_value_ready || m_value_ready->finished())) {
741 return &m_value;
742 }
743 return nullptr;
744}
745
746TensorPtr Tensor::make_scalar(DTypeScalar value, CompNode cn) {
747 HostTensorND hv{cn, value.dtype()};

Callers 4

get_static_infer_valueFunction · 0.80
apply_on_physical_tensorFunction · 0.80
dispatch_default_cpuMethod · 0.80
valueMethod · 0.80

Calls 2

finishedMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected