Browse Source

!5747 fix one_hot bug

Merge pull request !5747 from zhaozhenlong/lite/op/issue/one_hot_result
tags/v1.0.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
9090812d53
2 changed files with 1 additions and 5 deletions
  1. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/fp32/one_hot.cc
  2. +0
    -4
      mindspore/lite/tools/converter/parser/tflite/tflite_one_hot_parser.cc

+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/fp32/one_hot.cc View File

@@ -179,7 +179,7 @@ kernel::LiteKernel *CpuOneHotFp32KernelCreator(const std::vector<lite::tensor::T
OpParameter *opParameter, const lite::Context *ctx,
const kernel::KernelKey &desc,
const mindspore::lite::PrimitiveC *primitive) {
if (opParameter != nullptr) {
if (opParameter == nullptr) {
MS_LOG(ERROR) << "OneHot opParameter nullptr.";
return nullptr;
}


+ 0
- 4
mindspore/lite/tools/converter/parser/tflite/tflite_one_hot_parser.cc View File

@@ -56,10 +56,6 @@ STATUS TfliteOneHotParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflit
MS_LOG(ERROR) << "tensor is null";
return RET_NULL_PTR;
}
const auto tensor_shape = tensor->shape;
if (axis < 0) {
axis += tensor_shape.size();
}
attr->axis = axis;

op->primitive->value.type = schema::PrimitiveType_OneHot;


Loading…
Cancel
Save