提交 e73f2799 编写于 作者: M Megvii Engine Team 提交者: Xinran Xu

fix(mgb/index): enable index desc empty

GitOrigin-RevId: 4f0ab7c6e7b214b110586df80b8e56eea42f7e3d
上级 b43f6a26
......@@ -91,8 +91,6 @@ FancyIndexingHelper::FancyIndexingHelper(
void FancyIndexingHelper::init(const IndexDesc &index_desc) {
mgb_assert(input().size() == m_idx_inp_start);
mgb_throw_if(index_desc.empty(), GraphError,
"empty index desc for subtensor opr");
mgb_assert(m_index_desc.empty());
m_input2idxonly_axis_indexer.resize(input().size(), nullptr);
......
......@@ -85,7 +85,7 @@ namespace serialization {
static cg::OperatorNodeBase* load(
OprLoadContext &ctx, const cg::VarNodeArray &inputs,
const OperatorNodeConfig &config) {
mgb_assert(inputs.size() >= 2);
mgb_assert(inputs.size() >= 1);
auto index_desc = ctx.read_param<IndexDescMaskDump>().
to_index_desc(inputs.begin() + 1, inputs.end());
return Opr::make(inputs[0], index_desc, config).node()->owner_opr();
......@@ -106,7 +106,7 @@ namespace serialization {
static cg::OperatorNodeBase* load(
OprLoadContext &ctx, const cg::VarNodeArray &inputs,
const OperatorNodeConfig &config) {
mgb_assert(inputs.size() >= 3);
mgb_assert(inputs.size() >= 2);
auto index_desc = ctx.read_param<IndexDescMaskDump>().
to_index_desc(inputs.begin() + 2, inputs.end());
return Opr::make(inputs[0], inputs[1],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册