diff --git a/mindspore/lite/schema/ops.fbs b/mindspore/lite/schema/ops.fbs index fe37c527807..7512f0ddc57 100644 --- a/mindspore/lite/schema/ops.fbs +++ b/mindspore/lite/schema/ops.fbs @@ -168,7 +168,7 @@ table FlattenGrad { } table Concat { axis: int; - n: int; + n: int; // DEPRECATED } table SoftMax { @@ -822,6 +822,7 @@ table Gather { } table GatherNd { + batchDims: int; // DEPRECATED } table Fill { diff --git a/mindspore/lite/src/ops/concat.cc b/mindspore/lite/src/ops/concat.cc index 457f8de8e6b..0af1abe9c8d 100644 --- a/mindspore/lite/src/ops/concat.cc +++ b/mindspore/lite/src/ops/concat.cc @@ -27,10 +27,8 @@ namespace mindspore { namespace lite { #ifdef PRIMITIVE_WRITEABLE int Concat::GetAxis() const { return this->primitive_->value.AsConcat()->axis; } -int Concat::GetN() const { return this->primitive_->value.AsConcat()->n; } void Concat::SetAxis(int axis) { this->primitive_->value.AsConcat()->axis = axis; } -void Concat::SetN(int n) { this->primitive_->value.AsConcat()->n = n; } int Concat::UnPackAttr(const Primitive &prim, const std::vector &inputs) { if (this->primitive_ == nullptr) { @@ -71,13 +69,12 @@ int Concat::UnPackToFlatBuilder(const schema::Primitive *primitive, flatbuffers: MS_LOG(ERROR) << "value_as_Concat return nullptr"; return RET_ERROR; } - auto val_offset = schema::CreateConcat(*fbb, attr->axis(), attr->n()); + auto val_offset = schema::CreateConcat(*fbb, attr->axis()); auto prim_offset = schema::CreatePrimitive(*fbb, schema::PrimitiveType_Concat, val_offset.o); fbb->Finish(prim_offset); return RET_OK; } int Concat::GetAxis() const { return this->primitive_->value_as_Concat()->axis(); } -int Concat::GetN() const { return this->primitive_->value_as_Concat()->n(); } PrimitiveC *ConcatCreator(const schema::Primitive *primitive) { return PrimitiveC::NewPrimitiveC(primitive); } Registry ConcatRegistry(schema::PrimitiveType_Concat, ConcatCreator); diff --git a/mindspore/lite/src/ops/concat.h b/mindspore/lite/src/ops/concat.h index 08dfa100213..c12c7f94d36 100644 --- a/mindspore/lite/src/ops/concat.h +++ b/mindspore/lite/src/ops/concat.h @@ -33,13 +33,11 @@ class Concat : public PrimitiveC { explicit Concat(schema::PrimitiveT *primitive) : PrimitiveC(primitive) {} int UnPackAttr(const Primitive &prim, const std::vector &inputs) override; void SetAxis(int axis); - void SetN(int n); #else int UnPackToFlatBuilder(const schema::Primitive *primitive, flatbuffers::FlatBufferBuilder *fbb) override; #endif int InferShape(std::vector inputs_, std::vector outputs_) override; int GetAxis() const; - int GetN() const; }; } // namespace lite } // namespace mindspore diff --git a/mindspore/lite/test/ut/src/scheduler_test.cc b/mindspore/lite/test/ut/src/scheduler_test.cc index e183de5f369..7514d2ed1ac 100644 --- a/mindspore/lite/test/ut/src/scheduler_test.cc +++ b/mindspore/lite/test/ut/src/scheduler_test.cc @@ -93,7 +93,6 @@ TEST_F(SchedulerTest, TestConstructSubGraphsTwoBranch) { concat->primitive->value.type = mindspore::schema::PrimitiveType_Concat; auto concat_primitive = new mindspore::schema::ConcatT; concat_primitive->axis = 3; - concat_primitive->n = 2; concat->primitive->value.value = concat_primitive; concat->name = "concat"; @@ -255,7 +254,6 @@ TEST_F(SchedulerTest, TestConstructSubGraphsThreeBranch) { concat->primitive->value.type = mindspore::schema::PrimitiveType_Concat; auto concat_primitive = new mindspore::schema::ConcatT; concat_primitive->axis = 3; - concat_primitive->n = 2; concat->primitive->value.value = concat_primitive; concat->name = "concat"; diff --git a/mindspore/lite/test/ut/tools/converter/parser/tflite/tflite_concat_parser_test.cc b/mindspore/lite/test/ut/tools/converter/parser/tflite/tflite_concat_parser_test.cc index 2d5fd6fe806..4a25d02db8f 100644 --- a/mindspore/lite/test/ut/tools/converter/parser/tflite/tflite_concat_parser_test.cc +++ b/mindspore/lite/test/ut/tools/converter/parser/tflite/tflite_concat_parser_test.cc @@ -35,7 +35,6 @@ TEST_F(TestTfliteParserConcat, AttrValue) { ASSERT_NE(meta_graph->nodes.front()->primitive->value.AsConcat(), nullptr); auto val = meta_graph->nodes.front()->primitive->value.AsConcat(); ASSERT_EQ(val->axis, 1); - ASSERT_EQ(val->n, 2); } } // namespace mindspore diff --git a/mindspore/lite/tools/converter/parser/caffe/caffe_concat_parser.cc b/mindspore/lite/tools/converter/parser/caffe/caffe_concat_parser.cc index 2db9fa09cce..3df92446f62 100644 --- a/mindspore/lite/tools/converter/parser/caffe/caffe_concat_parser.cc +++ b/mindspore/lite/tools/converter/parser/caffe/caffe_concat_parser.cc @@ -60,7 +60,6 @@ STATUS CaffeConcatParser::Parse(const caffe::LayerParameter &proto, const caffe: MS_LOG(DEBUG) << "by default, set axis = 1"; attr->axis = 1; } - attr->n = proto.bottom_size(); op->name = proto.name(); op->primitive->value.type = schema::PrimitiveType_Concat; diff --git a/mindspore/lite/tools/converter/parser/tflite/tflite_concat_parser.cc b/mindspore/lite/tools/converter/parser/tflite/tflite_concat_parser.cc index 8f290bf184c..076c562179f 100644 --- a/mindspore/lite/tools/converter/parser/tflite/tflite_concat_parser.cc +++ b/mindspore/lite/tools/converter/parser/tflite/tflite_concat_parser.cc @@ -34,7 +34,6 @@ PrimitiveC *TfliteConcatParser::ParseLitePrimitive(const std::unique_ptraxis = tfliteAttr->axis; - attr->n = tflite_op->inputs.size(); primitive->value.type = schema::PrimitiveType_Concat; primitive->value.value = attr.release(); return PrimitiveC::Create(primitive.release());