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

Method do_infer_value

src/core/impl/graph/static_infer_impl.cpp:953–968  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

951}
952
953const DeviceTensorND* StaticInferManagerImpl::do_infer_value(
954 Tag dest, bool allow_fail) {
955 MGB_LOCK_GUARD(m_mtx);
956 MGB_TRY {
957 auto&& container = get_tag_trait_container(dest);
958 mgb_assert(
959 container.value,
960 "infer desc for var has not been added for infer_value: %s",
961 cg::dump_var_info({dest}).c_str());
962 auto ret = container.value->infer(false, allow_fail);
963 if (!ret) {
964 mgb_assert(allow_fail);
965 return nullptr;
966 }
967 return &ret->value();
968 }
969 MGB_CATCH(MegBrainError & exc, { update_rethrow_exc(dest, exc); })
970}
971

Callers

nothing calls this directly

Calls 2

inferMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected