!5747 fix one_hot bug

Merge pull request !5747 from zhaozhenlong/lite/op/issue/one_hot_result
This commit is contained in:
mindspore-ci-bot 2020-09-04 15:56:25 +08:00 committed by Gitee
commit 9090812d53
2 changed files with 1 additions and 5 deletions

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;
}

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;