diff --git a/mindspore/ccsrc/transform/convert.cc b/mindspore/ccsrc/transform/convert.cc index 417989247ed8466ce15bade5ff070666a67976ba..3b05dbf3ec1fdba85bf3e8da14f91e0cdb5afa3a 100755 --- a/mindspore/ccsrc/transform/convert.cc +++ b/mindspore/ccsrc/transform/convert.cc @@ -269,7 +269,7 @@ std::unordered_map &DfGraphConvertor::get_adpt_ma {string(kNameArgMinWithValue), ADPT_DESC(ArgMinWithValue)}, {prim::kPrimReduceSum->name(), ADPT_DESC(ReduceSumD)}, {prim::kPrimReduceMean->name(), ADPT_DESC(ReduceMeanD)}, - {prim::kPrimReduceAll->name(), ADPT_DESC(ReduceAll)}, + {prim::kPrimReduceAll->name(), ADPT_DESC(ReduceAllD)}, {prim::kPrimReduceMin->name(), ADPT_DESC(ReduceMinD)}, {prim::kPrimReduceMax->name(), ADPT_DESC(ReduceMaxD)}, {string(kNameLARSUpdate), ADPT_DESC(LarsV2Update)}, diff --git a/mindspore/ccsrc/transform/op_declare.cc b/mindspore/ccsrc/transform/op_declare.cc index 420edc685ae0283f2033f968c597268ecb812969..f39d7e4223060f2f4285731eb5fd181969ff441a 100644 --- a/mindspore/ccsrc/transform/op_declare.cc +++ b/mindspore/ccsrc/transform/op_declare.cc @@ -268,11 +268,6 @@ INPUT_MAP(GatherV2) = {{1, INPUT_DESC(x)}, {2, INPUT_DESC(indices)}, {3, INPUT_D ATTR_MAP(GatherV2) = EMPTY_ATTR_MAP; OUTPUT_MAP(GatherV2) = {{0, OUTPUT_DESC(y)}}; -// ReduceSum -INPUT_MAP(ReduceSum) = {{1, INPUT_DESC(x)}, {2, INPUT_DESC(axis)}}; -ATTR_MAP(ReduceSum) = {{"keep_dims", ATTR_DESC(keep_dims, AnyTraits())}}; -OUTPUT_MAP(ReduceSum) = {{0, OUTPUT_DESC(y)}}; - // ReduceSumD INPUT_MAP(ReduceSumD) = {{1, INPUT_DESC(x)}}; INPUT_ATTR_MAP(ReduceSumD) = { @@ -653,10 +648,12 @@ ATTR_MAP(ArgMinWithValue) = {{"axis", ATTR_DESC(dimension, AnyTraits())}, {"keep_dims", ATTR_DESC(keep_dims, AnyTraits())}}; OUTPUT_MAP(ArgMinWithValue) = {{0, OUTPUT_DESC(indice)}, {1, OUTPUT_DESC(values)}}; -// ReduceAll -INPUT_MAP(ReduceAll) = {{1, INPUT_DESC(x)}, {2, INPUT_DESC(axis)}}; -ATTR_MAP(ReduceAll) = {{"keep_dims", ATTR_DESC(keep_dims, AnyTraits())}}; -OUTPUT_MAP(ReduceAll) = {{0, OUTPUT_DESC(y)}}; +// ReduceAllD +INPUT_MAP(ReduceAllD) = {{1, INPUT_DESC(x)}}; +INPUT_ATTR_MAP(ReduceAllD) = { + {2, ATTR_DESC(axis, AnyTraits>(), AnyTraits>())}}; +ATTR_MAP(ReduceAllD) = {{"keep_dims", ATTR_DESC(keep_dims, AnyTraits())}}; +OUTPUT_MAP(ReduceAllD) = {{0, OUTPUT_DESC(y)}}; // ReduceMeanD INPUT_MAP(ReduceMeanD) = {{1, INPUT_DESC(x)}}; diff --git a/mindspore/ccsrc/transform/op_declare.h b/mindspore/ccsrc/transform/op_declare.h index 8b32e16b35b5a5046068ba1a3609cc397e598449..3be3546455802eb2b84ae0be19c23f5d263cab13 100755 --- a/mindspore/ccsrc/transform/op_declare.h +++ b/mindspore/ccsrc/transform/op_declare.h @@ -346,10 +346,9 @@ DECLARE_OP_USE_OUTPUT(Sin) DECLARE_OP_ADAPTER(Exp) DECLARE_OP_USE_OUTPUT(Exp) -DECLARE_OP_ADAPTER(ReduceAll) -DECLARE_OP_USE_OUTPUT(ReduceAll) -DECLARE_OP_ADAPTER(ReduceSum) -DECLARE_OP_USE_OUTPUT(ReduceSum) +DECLARE_OP_ADAPTER(ReduceAllD) +DECLARE_OP_USE_INPUT_ATTR(ReduceAllD) +DECLARE_OP_USE_OUTPUT(ReduceAllD) DECLARE_OP_ADAPTER(ReduceSumD) DECLARE_OP_USE_INPUT_ATTR(ReduceSumD) DECLARE_OP_USE_OUTPUT(ReduceSumD)