forked from mindspore-Ecosystem/mindspore
[MSLITE][DEVELOP] fix bug of delegate resize
This commit is contained in:
parent
3ed96b8838
commit
f5a4a9dcb0
|
@ -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