aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/NEON/functions/NELocallyConnectedLayer.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-03-08 19:09:19 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:49:16 +0000
commit1562be3e8a449360a90af75f6f1481a30d41be75 (patch)
tree3180551f4c8595ae5c9630694754f3b1f8b493b1 /src/runtime/NEON/functions/NELocallyConnectedLayer.cpp
parent684cb0f29d23fbe418e5e5347234abf9eccef363 (diff)
downloadComputeLibrary-1562be3e8a449360a90af75f6f1481a30d41be75.tar.gz
COMPMID-998: Release unused trainable parameters.
Change-Id: I361a520f34080016a25bc86e1e6789777c5152c1 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/124432 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/NEON/functions/NELocallyConnectedLayer.cpp')
-rw-r--r--src/runtime/NEON/functions/NELocallyConnectedLayer.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/runtime/NEON/functions/NELocallyConnectedLayer.cpp b/src/runtime/NEON/functions/NELocallyConnectedLayer.cpp
index 973559441f..913acf86a2 100644
--- a/src/runtime/NEON/functions/NELocallyConnectedLayer.cpp
+++ b/src/runtime/NEON/functions/NELocallyConnectedLayer.cpp
@@ -73,7 +73,7 @@ void calculate_shapes(const ITensorInfo *input, const ITensorInfo *weights, cons
NELocallyConnectedLayer::NELocallyConnectedLayer(std::shared_ptr<IMemoryManager> memory_manager)
: _memory_group(std::move(memory_manager)), _input_im2col_kernel(), _weights_reshape_kernel(), _mm_kernel(), _output_col2im_kernel(), _input_im2col_reshaped(), _weights_reshaped(), _gemm_output(),
- _is_first_run(false)
+ _is_first_run(false), _original_weights(nullptr)
{
}
@@ -126,8 +126,9 @@ void NELocallyConnectedLayer::configure(const ITensor *input, const ITensor *wei
ARM_COMPUTE_ERROR_ON_NULLPTR(input, weights, output);
ARM_COMPUTE_ERROR_THROW_ON(NELocallyConnectedLayer::validate(input->info(), weights->info(), biases == nullptr ? nullptr : biases->info(), output->info(), conv_info));
- bool _has_bias = (biases != nullptr);
- _is_first_run = true;
+ bool _has_bias = (biases != nullptr);
+ _is_first_run = true;
+ _original_weights = weights;
const unsigned int kernel_width = weights->info()->dimension(0);
const unsigned int kernel_height = weights->info()->dimension(1);
@@ -169,8 +170,13 @@ void NELocallyConnectedLayer::run()
// Run weights reshaping (Runs once for every configure)
if(_is_first_run)
{
+ ARM_COMPUTE_ERROR_ON(!_original_weights->is_used());
+
_is_first_run = false;
NEScheduler::get().schedule(&_weights_reshape_kernel, 3);
+
+ // Mark original weights tensor as unused
+ _original_weights->mark_as_unused();
}
_memory_group.acquire();