[MSLITE][DEVELOP] fix bug of delegate resize

This commit is contained in:
yangruoqi713 2021-07-06 20:55:40 +08:00
parent 3ed96b8838
commit f5a4a9dcb0
1 changed files with 11 additions and 11 deletions

View File

@ -822,11 +822,10 @@ int LiteSession::ReSizeKernels(const std::vector<kernel::LiteKernel *> &kernels)
MS_LOG(ERROR) << "input kernel is nullptr!";
return RET_ERROR;
}
if (kernel->subgraph_type() == kernel::kNotSubGraph) {
MS_LOG(ERROR) << "All node in graph should be sub_graph";
return RET_ERROR;
}
auto ret = RET_OK;
if (kernel->desc().delegate != nullptr) {
ret = kernel->ReSize();
} else {
if (kernel->subgraph_type() == kernel::kGpuSubGraph) {
#if GPU_OPENCL
auto sub_graph = reinterpret_cast<kernel::OpenCLSubGraph *>(kernel);
@ -836,6 +835,7 @@ int LiteSession::ReSizeKernels(const std::vector<kernel::LiteKernel *> &kernels)
auto sub_graph = reinterpret_cast<kernel::SubGraphKernel *>(kernel);
ret = sub_graph->ReSize();
}
}
if (ret == RET_INFER_INVALID) {
MS_LOG(INFO) << "InferShape is interrupted";
continue;