aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/tensor.py
diff options
context:
space:
mode:
authorDwight Lidman <dwight.lidman@arm.com>2020-05-13 12:00:08 +0200
committerTim Hall <tim.hall@arm.com>2020-06-18 17:53:52 +0100
commita9390f7fbd35dca75e80710835f67bb1d75d7c93 (patch)
treedf3606c28425e3a3504b29fe79ac8ddd0e2b8661 /ethosu/vela/tensor.py
parent388e9c230898385df59e6175aa45012e5864c09a (diff)
downloadethos-u-vela-a9390f7fbd35dca75e80710835f67bb1d75d7c93.tar.gz
MLBEDSW-1971: Verify ifm block size calculation against specification
This commit ensures the IFM block size calculation in architecture_features.py matches the specification by correctly setting the ifm upscaling factor based on the upscaling mode. This requires adding an attribute to the Tensor object which stores the upscaling mode for that specific tensor and making sure that information is correctly carried over to shared_buffer_allocation.py. Signed-off-by: Dwight Lidman <dwight.lidman@arm.com> Change-Id: I4ab56086f4c694d3bf759bbad30cdb969b4a26db
Diffstat (limited to 'ethosu/vela/tensor.py')
-rw-r--r--ethosu/vela/tensor.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ethosu/vela/tensor.py b/ethosu/vela/tensor.py
index 19258b52..160cf630 100644
--- a/ethosu/vela/tensor.py
+++ b/ethosu/vela/tensor.py
@@ -21,6 +21,7 @@ import uuid
import numpy as np
from . import numeric_util
+from .ethos_u55_regs.ethos_u55_regs import resampling_mode
from .numeric_util import round_up_divide
from .range_set import MemoryRangeSet
@@ -230,6 +231,7 @@ class Tensor:
"cpu_tensor",
"npu_tensor",
"equivalence_id",
+ "resampling_mode",
)
AllocationQuantum = 16
@@ -274,6 +276,7 @@ class Tensor:
self.reshaped = False
self.block_traversal = TensorBlockTraversal.Default
+ self.resampling_mode = resampling_mode.NONE
def element_size(self):
if self.element_size_bytes == 0:
@@ -312,6 +315,8 @@ class Tensor:
else:
res.quantization = None
+ res.resampling_mode = self.resampling_mode
+
return res
def clone_into_fast_storage(self, arch):