aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/tensor.py
diff options
context:
space:
mode:
authorPatrik Gustavsson <patrik.gustavsson@arm.com>2020-08-13 13:41:05 +0200
committerFredrik Knutsson <fredrik.knutsson.hunnebo@gmail.com>2020-08-14 10:49:15 +0000
commit458a208c44f70a9848f1e8e2e91f28ce3641c48f (patch)
tree37f23561f75d61746383dafc987b411646baaed8 /ethosu/vela/tensor.py
parentbe733cf04bb262d4eee791d76f01cecd64ff9255 (diff)
downloadethos-u-vela-458a208c44f70a9848f1e8e2e91f28ce3641c48f.tar.gz
MLBEDSW-2570 Avoid usage of NHCWB16 for some cases
Avoid usage of NHCWB16 when Stack/Pack/Concat is performed in axis 3, and the "concat start" of each slice to be combined is not a multiple of 16. Signed-off-by: Patrik Gustavsson <patrik.gustavsson@arm.com> Change-Id: If3f7b4a3424be3c86fc2dc48e8649ce4c4f49485
Diffstat (limited to 'ethosu/vela/tensor.py')
-rw-r--r--ethosu/vela/tensor.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ethosu/vela/tensor.py b/ethosu/vela/tensor.py
index 35749709..ecca0e0e 100644
--- a/ethosu/vela/tensor.py
+++ b/ethosu/vela/tensor.py
@@ -300,6 +300,7 @@ class Tensor:
"npu_tensor",
"equivalence_id",
"resampling_mode",
+ "avoid_NHCWB16",
)
AllocationQuantum = 16
@@ -346,6 +347,8 @@ class Tensor:
self.block_traversal = TensorBlockTraversal.Default
self.resampling_mode = resampling_mode.NONE
+ self.avoid_NHCWB16 = False
+
def element_size(self):
if self.element_size_bytes == 0:
return self.dtype.size_in_bits() / 8
@@ -380,6 +383,7 @@ class Tensor:
res.resampling_mode = self.resampling_mode
res.copy_compressed_weight_info(self)
+ res.avoid_NHCWB16 = self.avoid_NHCWB16
return res
def clone_into_fast_storage(self, arch):