aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/operation.py
diff options
context:
space:
mode:
authorRickard Bolin <rickard.bolin@arm.com>2022-09-06 16:09:01 +0000
committerRickard Bolin <rickard.bolin@arm.com>2022-09-15 16:49:21 +0000
commit17e53b5d776109e1bd1073c657ff0453ccf3c09e (patch)
tree15342201d082be81eb1884ce8f0914c884cb9784 /ethosu/vela/operation.py
parent7f3ccd5500458de0b56f05ed99553360c46e6b41 (diff)
downloadethos-u-vela-17e53b5d776109e1bd1073c657ff0453ccf3c09e.tar.gz
MLBEDSW-6927: Add ofm_stride_multiplier attribute to operation
Allow sparse writing of OFM by multiplying H/W/C of the OFM with the values of ofm_stride_multiplier Signed-off-by: Rickard Bolin <rickard.bolin@arm.com> Change-Id: I65d742ad36ad3154e9914cdd22e2da928ad1f095
Diffstat (limited to 'ethosu/vela/operation.py')
-rw-r--r--ethosu/vela/operation.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ethosu/vela/operation.py b/ethosu/vela/operation.py
index de68b1d7..e1622049 100644
--- a/ethosu/vela/operation.py
+++ b/ethosu/vela/operation.py
@@ -501,6 +501,7 @@ class Operation:
"write_offset",
"write_shape",
"ifm_resampling_mode",
+ "ofm_stride_multiplier",
)
def __init__(self, op_type: Op, name: str):
@@ -545,6 +546,9 @@ class Operation:
# write_offset 0,9,0,0, write_shape 1,1,8,1
self.write_shape: Optional[Shape4D] = None
self.ifm_resampling_mode: resampling_mode = resampling_mode.NONE
+ # For interleaved/sparse outputs - stride is multiplied with the stride factor of the corresponding axis
+ # Order is [C, H, W] - default is no multiplication
+ self.ofm_stride_multiplier: List[int] = [1, 1, 1]
def clone(self, suffix="_clone"):
res = Operation(self.type, self.name + suffix)
@@ -568,6 +572,7 @@ class Operation:
res.low_precision_scaling = self.low_precision_scaling
res.rescale = self.rescale
res.ifm_resampling_mode = self.ifm_resampling_mode
+ res.ofm_stride_multiplier = self.ofm_stride_multiplier.copy()
return res