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

Function get_input_layout_constraint

imperative/src/impl/ops/indexing.cpp:155–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153 return {out};
154}
155SmallVector<VarNode::LayoutConstraintCallback> get_input_layout_constraint(
156 const OpDef& def, const SmallVector<TensorPtr>& inputs) {
157 SmallVector<VarNode::LayoutConstraintCallback> layout_checker(inputs.size());
158 layout_checker[0] = layout_checker[1] = layout_checker[2] =
159 [](const TensorLayout& layout) { return layout.is_contiguous(); };
160 return layout_checker;
161}
162
163OP_TRAIT_REG(IndexingSetOneHot, IndexingSetOneHot)
164 .infer_output_attrs_fallible(infer_output_attrs_fallible)

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
is_contiguousMethod · 0.45

Tested by

no test coverage detected