From 88aaebf23df5778a662282c8e96fed87dc937fde Mon Sep 17 00:00:00 2001 From: yeyunpeng Date: Tue, 18 Aug 2020 18:50:53 +0800 Subject: [PATCH] fix bugs --- mindspore/lite/include/model.h | 1 - mindspore/lite/src/executor.cc | 7 ------- mindspore/lite/src/kernel_registry.cc | 9 +++++---- mindspore/lite/src/ops/primitive_c.h | 2 +- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/mindspore/lite/include/model.h b/mindspore/lite/include/model.h index daae904b809..2a880ca0ae7 100644 --- a/mindspore/lite/include/model.h +++ b/mindspore/lite/include/model.h @@ -21,7 +21,6 @@ #include #include #include "schema/model_generated.h" -#include "src/ops/primitive_c.h" namespace mindspore { #define MS_API __attribute__((visibility("default"))) diff --git a/mindspore/lite/src/executor.cc b/mindspore/lite/src/executor.cc index 5314c368a4e..38825d8d42a 100644 --- a/mindspore/lite/src/executor.cc +++ b/mindspore/lite/src/executor.cc @@ -49,13 +49,6 @@ int Executor::Run(std::vector &in_tensors, std::vectorname(); return ret; } - MS_LOG(INFO) << "out_tensors"; - auto tensors = kernel->out_tensors(); - MS_LOG(INFO) << kernel->name(); - for (int i = 0; i < tensors.size(); ++i) { - auto tensor = tensors[i]; - MS_LOG(INFO) << tensor->ToString(); - } if (after != nullptr) { if (!after(PackToMSTensors(kernel->in_tensors()), PackToMSTensors(kernel->out_tensors()), {kernel->name(), kernel->type_str()})) { diff --git a/mindspore/lite/src/kernel_registry.cc b/mindspore/lite/src/kernel_registry.cc index fa2ec89c0b8..351ac837522 100644 --- a/mindspore/lite/src/kernel_registry.cc +++ b/mindspore/lite/src/kernel_registry.cc @@ -123,14 +123,15 @@ bool KernelRegistry::Merge(const std::unordered_map &n const kernel::KernelCreator *KernelRegistry::GetCreatorArrays() { return creator_arrays_; } kernel::LiteKernel *KernelRegistry::GetKernel(const std::vector &in_tensors, - const std::vector &out_tensors, - const PrimitiveC *primitive, const Context *ctx, - const kernel::KernelKey &key) { + const std::vector &out_tensors, + const PrimitiveC *primitive, const Context *ctx, + const kernel::KernelKey &key) { MS_EXCEPTION_IF_NULL(primitive); MS_EXCEPTION_IF_NULL(ctx); auto parameter = kernel::PopulateParameter(primitive); if (parameter == nullptr) { - MS_LOG(ERROR) << "PopulateParameter return nullptr, type: " << primitive->Type(); + MS_LOG(ERROR) << "PopulateParameter return nullptr, type: " + << schema::EnumNamePrimitiveType((schema::PrimitiveType)primitive->Type()); return nullptr; } auto creator = GetCreator(key); diff --git a/mindspore/lite/src/ops/primitive_c.h b/mindspore/lite/src/ops/primitive_c.h index 72a030074f1..80c3e0d92de 100644 --- a/mindspore/lite/src/ops/primitive_c.h +++ b/mindspore/lite/src/ops/primitive_c.h @@ -40,7 +40,7 @@ constexpr uint32_t kDoubleNum = 2; constexpr uint32_t kMultiNum = 3; constexpr uint32_t kDimension_4d = 4; -const std::set kSupportDataType = {kNumberTypeUInt8, kNumberTypeInt32, kNumberTypeFloat32}; +const std::set kSupportDataType = {kNumberTypeUInt8, kNumberTypeInt32, kNumberTypeFloat32, kNumberTypeFloat16}; // #if LITE_OPTIMIZE class PrimitiveC {