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

Function init_output_static_infer_desc

src/core/test/sublinear_memory.cpp:48–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 }
47
48 void init_output_static_infer_desc() override {
49 using namespace cg::static_infer;
50 auto&& mgr = owner_graph()->static_infer_manager();
51 auto infer_shape = [this](TensorShape& dst, const InpVal& inp) {
52 size_t n = inp.val.at(0).shape().total_nr_elems();
53 dst = TensorShape{n * m_scale};
54 return true;
55 };
56 mgr.register_shape_infer(
57 output(0),
58 {SourceType::DEP, {{input(0), DepType::SHAPE}}, infer_shape});
59 }
60
61public:
62 SublinearBadOpr(

Callers

nothing calls this directly

Calls 4

total_nr_elemsMethod · 0.45
shapeMethod · 0.45
atMethod · 0.45
register_shape_inferMethod · 0.45

Tested by

no test coverage detected