forked from mindspore-Ecosystem/mindspore
!5451 remove parameter destruction in subgraph
Merge pull request !5451 from wandongdong/master
This commit is contained in:
commit
ad638d69de
|
@ -74,7 +74,10 @@ class LiteKernel {
|
|||
}
|
||||
|
||||
virtual ~LiteKernel() {
|
||||
if (op_parameter_ != nullptr) {
|
||||
free(op_parameter_);
|
||||
op_parameter_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
virtual int Prepare();
|
||||
|
|
|
@ -261,26 +261,21 @@ int SubGraphOpenCLKernel::GetKernelFromToTensor(const std::vector<lite::tensor::
|
|||
}
|
||||
|
||||
int SubGraphOpenCLKernel::UnInit() {
|
||||
for (const auto tensor : in_convert_tensors_) {
|
||||
for (const auto &tensor : in_convert_tensors_) {
|
||||
if (tensor != nullptr) {
|
||||
delete tensor;
|
||||
}
|
||||
}
|
||||
for (const auto tensor : out_convert_tensors_) {
|
||||
for (const auto &tensor : out_convert_tensors_) {
|
||||
if (tensor != nullptr) {
|
||||
delete tensor;
|
||||
}
|
||||
}
|
||||
for (const auto op : in_convert_ops_) {
|
||||
for (const auto &op : in_convert_ops_) {
|
||||
if (op != nullptr) {
|
||||
delete op;
|
||||
}
|
||||
}
|
||||
for (const auto parameter : in_parameters_) {
|
||||
if (parameter != nullptr) {
|
||||
delete parameter;
|
||||
}
|
||||
}
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue