aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/runtime/NEON/functions/NEDepthwiseConvolutionLayer.cpp5
-rw-r--r--src/runtime/cpu/operators/CpuDepthwiseConvolution.cpp4
2 files changed, 5 insertions, 4 deletions
diff --git a/src/runtime/NEON/functions/NEDepthwiseConvolutionLayer.cpp b/src/runtime/NEON/functions/NEDepthwiseConvolutionLayer.cpp
index 1d7b1c677b..da9610ef42 100644
--- a/src/runtime/NEON/functions/NEDepthwiseConvolutionLayer.cpp
+++ b/src/runtime/NEON/functions/NEDepthwiseConvolutionLayer.cpp
@@ -121,7 +121,7 @@ void NEDepthwiseConvolutionLayer::NEDepthwiseConvolutionLayerOptimizedInternal::
_impl->permuted_output.info()->set_quantization_info(output->info()->quantization_info());
// Configure optimized depthwise
- dwc_optimized_func->configure(_impl->permuted_input.info(), _impl->permuted_weights.info(), biases->info(), _impl->permuted_output.info(), info);
+ dwc_optimized_func->configure(_impl->permuted_input.info(), _impl->permuted_weights.info(), biases == nullptr ? nullptr : biases->info(), _impl->permuted_output.info(), info);
// Configure the function to transform the convoluted output to ACL's native ordering format NCHW
_impl->permuted_output.info()->set_data_layout(DataLayout::NHWC);
@@ -132,7 +132,7 @@ void NEDepthwiseConvolutionLayer::NEDepthwiseConvolutionLayerOptimizedInternal::
}
else
{
- dwc_optimized_func->configure(_impl->src->info(), _impl->weights->info(), biases->info(), _impl->dst->info(), info);
+ dwc_optimized_func->configure(_impl->src->info(), _impl->weights->info(), biases == nullptr ? nullptr : biases->info(), _impl->dst->info(), info);
}
// Allocate memory based on the internal memory requirements
@@ -184,7 +184,6 @@ void NEDepthwiseConvolutionLayer::NEDepthwiseConvolutionLayerOptimizedInternal::
if(_impl->permute)
{
_impl->permuted_weights.allocator()->allocate();
- _impl->weights->mark_as_unused();
}
if(!_impl->permuted_weights.is_used())
diff --git a/src/runtime/cpu/operators/CpuDepthwiseConvolution.cpp b/src/runtime/cpu/operators/CpuDepthwiseConvolution.cpp
index 183a2af0cd..6d097280e0 100644
--- a/src/runtime/cpu/operators/CpuDepthwiseConvolution.cpp
+++ b/src/runtime/cpu/operators/CpuDepthwiseConvolution.cpp
@@ -170,7 +170,7 @@ void CpuDepthwiseConvolution::CpuDepthwiseConvolutionOptimizedInternal::run(ITen
if(_permute)
{
ITensorPack pack;
- auto src = tensors.get_tensor(TensorType::ACL_SRC_0);
+ auto src = tensors.get_const_tensor(TensorType::ACL_SRC_0);
auto src_perm = tensors.get_tensor(TensorType::ACL_INT_0);
pack.add_tensor(TensorType::ACL_SRC, src);
pack.add_tensor(TensorType::ACL_DST, src_perm);
@@ -247,6 +247,8 @@ void CpuDepthwiseConvolution::CpuDepthwiseConvolutionOptimizedInternal::prepare(
pack.add_tensor(TensorType::ACL_DST, permuted_weights);
_permute_weights->run(pack);
+ weights->mark_as_unused();
+
ITensorPack pack_opt;
pack_opt.add_const_tensor(TensorType::ACL_SRC_1, permuted_weights);
pack_opt.add_tensor(TensorType::ACL_SRC_2, bias);