fix onehot converter parser axis bug

This commit is contained in:
zhaozhenlong 2020-09-03 19:08:42 +08:00
parent fbf8a3bbcc
commit 89daa7d5e4
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;