Browse Source

Fix bug of anf importer to support MS model converter.

tags/v1.0.0
wsc 5 years ago
parent
commit
dfc264d1fb
2 changed files with 5 additions and 2 deletions
  1. +1
    -1
      mindspore/lite/src/ops/pooling.cc
  2. +4
    -1
      mindspore/lite/src/ops/primitive_c.cc

+ 1
- 1
mindspore/lite/src/ops/pooling.cc View File

@@ -80,7 +80,7 @@ int Pooling::UnPackAttr(const Primitive &prim, const std::vector<AnfNodePtr> &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;
}



+ 4
- 1
mindspore/lite/src/ops/primitive_c.cc View File

@@ -375,7 +375,7 @@ std::shared_ptr<PrimitiveC> PrimitiveC::Create(const Primitive &prim, const std:
return NewPrimitiveC<MatMul>(prim, inputs, quantType);
} else if (op_type == "Mul") {
return NewPrimitiveC<Mul>(prim, inputs, quantType);
} else if (op_type == "MaxPool") {
} else if (op_type == "MaxPool" || op_type == "AvgPool") {
return NewPrimitiveC<Pooling>(prim, inputs, quantType);
} else if (op_type == "Quant") {
return NewPrimitiveC<Quant>(prim, inputs, quantType);
@@ -397,6 +397,9 @@ std::shared_ptr<PrimitiveC> PrimitiveC::Create(const Primitive &prim, const std:
return NewPrimitiveC<TupleGetItem>(prim, inputs, quantType);
} else if (op_type == "Softmax") {
return NewPrimitiveC<SoftMax>(prim, inputs, quantType);
} else if (op_type == "StridedSlice") {
return NewPrimitiveC<StridedSlice>(prim, inputs, quantType);


#ifdef SUPPORT_TRAIN
} else if (op_type == "SoftmaxCrossEntropyWithLogits") {


Loading…
Cancel
Save