From dfc264d1fbd1635e7801aecf838f6d575fe2ca32 Mon Sep 17 00:00:00 2001 From: wsc Date: Sat, 12 Sep 2020 16:55:33 +0800 Subject: [PATCH] Fix bug of anf importer to support MS model converter. --- mindspore/lite/src/ops/pooling.cc | 2 +- mindspore/lite/src/ops/primitive_c.cc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mindspore/lite/src/ops/pooling.cc b/mindspore/lite/src/ops/pooling.cc index 5c94a6cd7f..8e0ef06da6 100644 --- a/mindspore/lite/src/ops/pooling.cc +++ b/mindspore/lite/src/ops/pooling.cc @@ -80,7 +80,7 @@ int Pooling::UnPackAttr(const Primitive &prim, const std::vector &in } if (prim.instance_name() == "MaxPool") { attr->poolingMode = schema::PoolMode_MAX_POOLING; - } else if (prim.instance_name() == "MeanPool") { + } else if (prim.instance_name() == "MeanPool" || prim.instance_name() == "AvgPool") { attr->poolingMode = schema::PoolMode_MEAN_POOLING; } diff --git a/mindspore/lite/src/ops/primitive_c.cc b/mindspore/lite/src/ops/primitive_c.cc index 364742ad8c..0e7f624eb8 100644 --- a/mindspore/lite/src/ops/primitive_c.cc +++ b/mindspore/lite/src/ops/primitive_c.cc @@ -375,7 +375,7 @@ std::shared_ptr PrimitiveC::Create(const Primitive &prim, const std: return NewPrimitiveC(prim, inputs, quantType); } else if (op_type == "Mul") { return NewPrimitiveC(prim, inputs, quantType); - } else if (op_type == "MaxPool") { + } else if (op_type == "MaxPool" || op_type == "AvgPool") { return NewPrimitiveC(prim, inputs, quantType); } else if (op_type == "Quant") { return NewPrimitiveC(prim, inputs, quantType); @@ -397,6 +397,9 @@ std::shared_ptr PrimitiveC::Create(const Primitive &prim, const std: return NewPrimitiveC(prim, inputs, quantType); } else if (op_type == "Softmax") { return NewPrimitiveC(prim, inputs, quantType); + } else if (op_type == "StridedSlice") { + return NewPrimitiveC(prim, inputs, quantType); + #ifdef SUPPORT_TRAIN } else if (op_type == "SoftmaxCrossEntropyWithLogits") {