!4667 Fix some irregularities

Merge pull request !4667 from yeyunpeng2020/master_cops_3
This commit is contained in:
mindspore-ci-bot 2020-08-18 19:01:25 +08:00 committed by Gitee
commit 0b3ab6b70f
4 changed files with 6 additions and 13 deletions

View File

@ -21,7 +21,6 @@
#include <vector> #include <vector>
#include <memory> #include <memory>
#include "schema/model_generated.h" #include "schema/model_generated.h"
#include "src/ops/primitive_c.h"
namespace mindspore { namespace mindspore {
#define MS_API __attribute__((visibility("default"))) #define MS_API __attribute__((visibility("default")))

View File

@ -49,13 +49,6 @@ int Executor::Run(std::vector<tensor::Tensor *> &in_tensors, std::vector<tensor:
MS_LOG(ERROR) << "run kernel failed, name: " << kernel->name(); MS_LOG(ERROR) << "run kernel failed, name: " << kernel->name();
return ret; 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 != nullptr) {
if (!after(PackToMSTensors(kernel->in_tensors()), PackToMSTensors(kernel->out_tensors()), if (!after(PackToMSTensors(kernel->in_tensors()), PackToMSTensors(kernel->out_tensors()),
{kernel->name(), kernel->type_str()})) { {kernel->name(), kernel->type_str()})) {

View File

@ -123,14 +123,15 @@ bool KernelRegistry::Merge(const std::unordered_map<KernelKey, KernelCreator> &n
const kernel::KernelCreator *KernelRegistry::GetCreatorArrays() { return creator_arrays_; } const kernel::KernelCreator *KernelRegistry::GetCreatorArrays() { return creator_arrays_; }
kernel::LiteKernel *KernelRegistry::GetKernel(const std::vector<tensor::Tensor *> &in_tensors, kernel::LiteKernel *KernelRegistry::GetKernel(const std::vector<tensor::Tensor *> &in_tensors,
const std::vector<tensor::Tensor *> &out_tensors, const std::vector<tensor::Tensor *> &out_tensors,
const PrimitiveC *primitive, const Context *ctx, const PrimitiveC *primitive, const Context *ctx,
const kernel::KernelKey &key) { const kernel::KernelKey &key) {
MS_EXCEPTION_IF_NULL(primitive); MS_EXCEPTION_IF_NULL(primitive);
MS_EXCEPTION_IF_NULL(ctx); MS_EXCEPTION_IF_NULL(ctx);
auto parameter = kernel::PopulateParameter(primitive); auto parameter = kernel::PopulateParameter(primitive);
if (parameter == nullptr) { 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; return nullptr;
} }
auto creator = GetCreator(key); auto creator = GetCreator(key);

View File

@ -40,7 +40,7 @@ constexpr uint32_t kDoubleNum = 2;
constexpr uint32_t kMultiNum = 3; constexpr uint32_t kMultiNum = 3;
constexpr uint32_t kDimension_4d = 4; constexpr uint32_t kDimension_4d = 4;
const std::set<int> kSupportDataType = {kNumberTypeUInt8, kNumberTypeInt32, kNumberTypeFloat32}; const std::set<int> kSupportDataType = {kNumberTypeUInt8, kNumberTypeInt32, kNumberTypeFloat32, kNumberTypeFloat16};
// #if LITE_OPTIMIZE // #if LITE_OPTIMIZE
class PrimitiveC { class PrimitiveC {