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

Method call_register_for_shape

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

Source from the content-addressed store, hash-verified

1365}
1366
1367bool StaticInferManagerImpl::SubgraphStaticInferHelperImpl::call_register_for_shape(
1368 Tag dest, const ShapeInferDesc& desc, RegisterHelperPtr helper) {
1369 mgb_assert(desc.src_type == SourceType::DEP);
1370
1371 auto callback = [&](StaticInferManagerImpl& mgr, SourceType src_type,
1372 const TagTraitArray& deps) -> TagTraitBase* {
1373 using namespace std::placeholders;
1374 auto f = std::bind(
1375 &SubgraphStaticInferHelperImpl::infer_shape_raw, deps, desc.infer_func,
1376 _1, _2);
1377
1378 mgr.register_shape_infer(dest, {src_type, {}, f});
1379 return mgr.get_tag_trait_container(dest).shape;
1380 };
1381
1382 return (this->*helper)(dest, desc.deps, callback);
1383}
1384
1385bool StaticInferManagerImpl::SubgraphStaticInferHelperImpl::call_register_for_value(
1386 Tag dest, const ValueInferDesc& desc, RegisterHelperPtr helper) {

Callers

nothing calls this directly

Calls 1

register_shape_inferMethod · 0.45

Tested by

no test coverage detected