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

Method init_output_static_infer_desc

src/opr/impl/loop/impl.cpp:320–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318}
319
320void LoopImpl::DescImplBase::CounterProvider::init_output_static_infer_desc() {
321 using namespace cg::static_infer;
322
323 auto&& mgr = owner_graph()->static_infer_manager();
324 mgr.register_shape_infer(output(0), ShapeInferDesc::make_const({1}));
325
326 auto infer_value = [this](DeviceTensorND& dest, const InpVal&) {
327 dest.resize({1}).ptr<int>()[0] = m_next_val;
328 return true;
329 };
330 mgr.register_value_infer(output(0), {SourceType::MUTABLE, {}, infer_value});
331}
332
333void LoopImpl::DescImplBase::CounterProvider::update_next_val() {
334 m_next_val += m_delta;

Callers

nothing calls this directly

Calls 6

make_constFunction · 0.85
resizeMethod · 0.80
register_shape_inferMethod · 0.45
register_value_inferMethod · 0.45

Tested by

no test coverage detected