!12429 correct data type before schedule npu kernel

From: @zhaozhenlong
Reviewed-by: @zhanghaibo5,@ddwsky
Signed-off-by: @zhanghaibo5
This commit is contained in:
mindspore-ci-bot 2021-02-20 09:40:03 +08:00 committed by Gitee
commit 73278d43ba
1 changed files with 3 additions and 0 deletions

View File

@ -209,6 +209,9 @@ kernel::LiteKernel *Scheduler::FindBackendKernel(const std::vector<Tensor *> &in
#endif
#if SUPPORT_NPU
if (context_->IsNpuEnabled()) {
if (desc.data_type == kNumberTypeFloat16) {
desc.data_type = kNumberTypeFloat32;
}
kernel::KernelKey npu_desc{kNPU, desc.data_type, desc.type};
auto *kernel = KernelRegistry::GetInstance()->GetKernel(in_tensors, out_tensors, primitive, context_, npu_desc);
if (kernel != nullptr) {