COMPMID-2693 Weights manager to mark the initial weights as unsued

Change-Id: Iaa964e71d0aa80fff0a465127ac3716563bbe85f
Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com>
Reviewed-on: https://review.mlplatform.org/c/2017
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
diff --git a/src/runtime/NEON/functions/NEFullyConnectedLayer.cpp b/src/runtime/NEON/functions/NEFullyConnectedLayer.cpp
index 7adc3bc..ee622f4 100644
--- a/src/runtime/NEON/functions/NEFullyConnectedLayer.cpp
+++ b/src/runtime/NEON/functions/NEFullyConnectedLayer.cpp
@@ -426,7 +426,6 @@
         {
             if(_weights_manager && _weights_manager->are_weights_managed(_original_weights))
             {
-                cur_weights->mark_as_unused();
                 cur_weights = _weights_manager->run(cur_weights, &_reshape_weights_managed_function);
             }
             else
@@ -455,9 +454,9 @@
             {
                 _converted_weights_output.allocator()->allocate();
                 _convert_weights.run();
+                cur_weights->mark_as_unused();
             }
 
-            cur_weights->mark_as_unused();
             _are_weights_converted = true;
         }