MLBEDSW-1941: Bug fix shared weights

If same weight tensor was used with different block configs,
errors would occur.

Fixed by always cloning weight tensors, using a global weight
compression cache and modifying the linear allocator to
detect multiple usage of same weight compression.

Change-Id: I91ca59176e1c59c66e0ac7a4227f2b5f0b47053f
Signed-off-by: Louis Verhaard <louis.verhaard@arm.com>
diff --git a/ethosu/vela/nn_graph.py b/ethosu/vela/nn_graph.py
index ed2ab32..ea35c08 100644
--- a/ethosu/vela/nn_graph.py
+++ b/ethosu/vela/nn_graph.py
@@ -485,6 +485,7 @@
         self.bits_per_element = {}
         self.total_size = {}
         self.total_elements = {}
+        self.weight_cache = None  # See CompressedWeightCache
 
     def get_root_subgraph(self):
         return self.subgraphs[0]