forked from mindspore-Ecosystem/mindspore
!5747 fix one_hot bug
Merge pull request !5747 from zhaozhenlong/lite/op/issue/one_hot_result
This commit is contained in:
commit
9090812d53
|
@ -179,7 +179,7 @@ kernel::LiteKernel *CpuOneHotFp32KernelCreator(const std::vector<lite::tensor::T
|
||||||
OpParameter *opParameter, const lite::Context *ctx,
|
OpParameter *opParameter, const lite::Context *ctx,
|
||||||
const kernel::KernelKey &desc,
|
const kernel::KernelKey &desc,
|
||||||
const mindspore::lite::PrimitiveC *primitive) {
|
const mindspore::lite::PrimitiveC *primitive) {
|
||||||
if (opParameter != nullptr) {
|
if (opParameter == nullptr) {
|
||||||
MS_LOG(ERROR) << "OneHot opParameter nullptr.";
|
MS_LOG(ERROR) << "OneHot opParameter nullptr.";
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,10 +56,6 @@ STATUS TfliteOneHotParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflit
|
||||||
MS_LOG(ERROR) << "tensor is null";
|
MS_LOG(ERROR) << "tensor is null";
|
||||||
return RET_NULL_PTR;
|
return RET_NULL_PTR;
|
||||||
}
|
}
|
||||||
const auto tensor_shape = tensor->shape;
|
|
||||||
if (axis < 0) {
|
|
||||||
axis += tensor_shape.size();
|
|
||||||
}
|
|
||||||
attr->axis = axis;
|
attr->axis = axis;
|
||||||
|
|
||||||
op->primitive->value.type = schema::PrimitiveType_OneHot;
|
op->primitive->value.type = schema::PrimitiveType_OneHot;
|
||||||
|
|
Loading…
Reference in New Issue