correct data type before schedule npu op

This commit is contained in:
zhaozhenlong 2021-02-19 17:19:07 +08:00
parent adfe6e1bc2
commit 09c338e092
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) {