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

Method do_infer_shape

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

Source from the content-addressed store, hash-verified

933}
934
935const TensorShape* StaticInferManagerImpl::do_infer_shape(Tag dest, bool allow_fail) {
936 MGB_LOCK_GUARD(m_mtx);
937 MGB_TRY {
938 auto&& container = get_tag_trait_container(dest);
939 mgb_assert(
940 container.shape,
941 "infer desc for var has not been added for infer_shape: %s",
942 cg::dump_var_info({dest}).c_str());
943 auto ret = container.shape->infer(false, allow_fail);
944 if (!ret) {
945 mgb_assert(allow_fail);
946 return nullptr;
947 }
948 return &ret->shape();
949 }
950 MGB_CATCH(MegBrainError & exc, { update_rethrow_exc(dest, exc); })
951}
952

Callers

nothing calls this directly

Calls 2

inferMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected