forked from mindspore-Ecosystem/mindspore
!19501 [MSLITE][DEVELOP] fix bug of delegate resize
Merge pull request !19501 from yangruoqi713/delegate_1
This commit is contained in:
commit
25ee89cf30
|
@ -822,19 +822,19 @@ 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->subgraph_type() == kernel::kGpuSubGraph) {
|
||||
#if GPU_OPENCL
|
||||
auto sub_graph = reinterpret_cast<kernel::OpenCLSubGraph *>(kernel);
|
||||
ret = sub_graph->ReSize(false);
|
||||
#endif
|
||||
if (kernel->desc().delegate != nullptr) {
|
||||
ret = kernel->ReSize();
|
||||
} else {
|
||||
auto sub_graph = reinterpret_cast<kernel::SubGraphKernel *>(kernel);
|
||||
ret = sub_graph->ReSize();
|
||||
if (kernel->subgraph_type() == kernel::kGpuSubGraph) {
|
||||
#if GPU_OPENCL
|
||||
auto sub_graph = reinterpret_cast<kernel::OpenCLSubGraph *>(kernel);
|
||||
ret = sub_graph->ReSize(false);
|
||||
#endif
|
||||
} else {
|
||||
auto sub_graph = reinterpret_cast<kernel::SubGraphKernel *>(kernel);
|
||||
ret = sub_graph->ReSize();
|
||||
}
|
||||
}
|
||||
if (ret == RET_INFER_INVALID) {
|
||||
MS_LOG(INFO) << "InferShape is interrupted";
|
||||
|
|
Loading…
Reference in New Issue