aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/high_level_command_stream.py
diff options
context:
space:
mode:
authorJacob Bohlin <jacob.bohlin@arm.com>2020-06-11 15:09:57 +0200
committerTim Hall <tim.hall@arm.com>2020-06-18 17:53:52 +0100
commit611fcdf8f0e33dabba4486eb78ce482c189248e5 (patch)
treef2265bb694b901d6ff6a57bd616fd0ead0ddc950 /ethosu/vela/high_level_command_stream.py
parent749d92115e8ac7d0cc755ce93ea8a8c53fd6e474 (diff)
downloadethos-u-vela-611fcdf8f0e33dabba4486eb78ce482c189248e5.tar.gz
MLBEDSW-2435: Fix for cascading upscaling operators
Fixed a coordinate issue which caused the compiler to crash when cascading upscaling operators such as ResizeBilinear. Signed-off-by: Jacob Bohlin <jacob.bohlin@arm.com> Change-Id: I982863573b0e5829e6d0c255dbbc308cb332a37a
Diffstat (limited to 'ethosu/vela/high_level_command_stream.py')
-rw-r--r--ethosu/vela/high_level_command_stream.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/ethosu/vela/high_level_command_stream.py b/ethosu/vela/high_level_command_stream.py
index 9b0298bb..f9048a1e 100644
--- a/ethosu/vela/high_level_command_stream.py
+++ b/ethosu/vela/high_level_command_stream.py
@@ -34,11 +34,17 @@ class Box:
assert self.start_coord[i] <= self.end_coord[i]
def transform_with_strides_and_skirt(
- self, strides, skirt, ifm_shape, npu_block_type, concat_axis=0, concat_offset=0, split_offset=None, k_height=1
+ self, strides, skirt, ifm_shape, npu_block_type, concat_axis=0, concat_offset=0, split_offset=None, k_height=1,
+ upscaling_factor=1
):
new_start_coord = list(self.start_coord)
new_end_coord = list(self.end_coord)
+ # Adjust for upscaling
+ if len(new_start_coord) == len(new_end_coord) == 4:
+ new_start_coord[1] = new_start_coord[1] // upscaling_factor
+ new_end_coord[1] = new_end_coord[1] // upscaling_factor
+
new_start_coord[concat_axis] -= concat_offset
new_end_coord[concat_axis] -= concat_offset