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

Method infer_desc

src/core/impl/graph/operator_node.cpp:628–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

626}
627
628bool mixin::OutshapePureByInshapeOpr::infer_desc(
629 size_t out_idx, TensorShape& dest, const StaticInferInpVal& inp) {
630 if (inp.run_id != m_inp_run_id) {
631 TensorShapeArray inp_shp(inp.val.size());
632 for (size_t i = 0; i < inp_shp.size(); ++i)
633 inp_shp[i] = inp.val[i].shape();
634 get_output_var_shape(inp_shp, m_out_shp);
635 mgb_assert(m_out_shp.size() == m_nr_managed_outputs);
636 m_inp_run_id = inp.run_id;
637 }
638 dest = m_out_shp.at(out_idx);
639 return true;
640}
641
642/* =================== mixins::IOSameShapeOperatorNode =================== */
643

Callers

nothing calls this directly

Calls 4

get_output_var_shapeFunction · 0.50
sizeMethod · 0.45
shapeMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected