MLBEDSW-2340: Make the tensor address default None

Signed-off-by: Charles Xu <charles.xu@arm.com>
Change-Id: I53d9d56acee57cff208dccb4822c1f1a461c416d
diff --git a/ethosu/vela/high_level_command_stream_generator.py b/ethosu/vela/high_level_command_stream_generator.py
index d02fd85..232a56c 100644
--- a/ethosu/vela/high_level_command_stream_generator.py
+++ b/ethosu/vela/high_level_command_stream_generator.py
@@ -216,7 +216,7 @@
         if len(passes) == 1:
             # no cascading, can just issue one big stripe
             # but only if we've done allocation and OFM does not overlap IFM
-            if ifm_tensor.address != -1 and ofm_tensor.address != -1:
+            if ifm_tensor.address is not None and ofm_tensor.address is not None:
                 if (
                     ifm_tensor.address + ifm_tensor.storage_size() <= ofm_tensor.address
                     or ofm_tensor.address + ofm_tensor.storage_size() <= ifm_tensor.address
diff --git a/ethosu/vela/live_range.py b/ethosu/vela/live_range.py
index 8fe3d57..fe00b62 100644
--- a/ethosu/vela/live_range.py
+++ b/ethosu/vela/live_range.py
@@ -85,7 +85,7 @@
     def set_address(self, address):
         # Set address of all unaddressed tensors in LiveRange
         for tens in self.tensors:
-            if tens.address == 0:
+            if tens.address is None:
                 addr = address
             else:
                 # Limit to single tensor for the lr if the tensor address already assigned
diff --git a/ethosu/vela/tensor.py b/ethosu/vela/tensor.py
index eda21c9..bc0597f 100644
--- a/ethosu/vela/tensor.py
+++ b/ethosu/vela/tensor.py
@@ -291,7 +291,7 @@
         self.weight_compressed_offsets = []
         self.storage_rounding_quantum = (1, 1, 1, 1)
         self.brick_size = (1, 1, 1, 1)
-        self.address = 0  # start address of tensor. will be filled in by tensor allocator
+        self.address = None  # start address of tensor. will be filled in by tensor allocator
         self.element_size_bytes = 0
 
         # quantization parameters
@@ -323,7 +323,7 @@
         res.alignment = self.alignment
         res.bandwidth_compression_scale = self.bandwidth_compression_scale
         res.storage_rounding_quantum = self.storage_rounding_quantum
-        res.address = 0
+        res.address = None
 
         if self.quantization is not None:
             res.quantization = self.quantization.clone()
diff --git a/ethosu/vela/tflite_writer.py b/ethosu/vela/tflite_writer.py
index 7e805e3..4aa23b5 100644
--- a/ethosu/vela/tflite_writer.py
+++ b/ethosu/vela/tflite_writer.py
@@ -401,7 +401,7 @@
         # Ensure that the order of the offsets match the order of the tensors
         for tens, idx in self.tensor_map.items():
             # Set offsets for tensor allocated in Tensor Arena or in the scratch_fast area
-            if tens.mem_type in set((MemType.Scratch, MemType.Scratch_fast)):
+            if tens.mem_type in set((MemType.Scratch, MemType.Scratch_fast)) and tens.address is not None:
                 offsets[idx] = np.int32(tens.address)
 
         metadata_buffer = np.array([version, subgraph_idx, nbr_tensors] + offsets)