aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/operation_util.py
diff options
context:
space:
mode:
authorJohan Alfvén <johan.alfven@arm.com>2022-10-19 11:20:12 +0200
committerJohan Alfvén <johan.alfven@arm.com>2022-10-20 14:38:55 +0200
commit56a71b0108f43a1cb118b1e2fae902c31b2a9969 (patch)
tree4692139c4dcd6e53b55b1a07ff1b09eb8461a4a8 /ethosu/vela/operation_util.py
parentfba0a7dc43373a69f3c0792587d3d9b0cc010ccf (diff)
downloadethos-u-vela-56a71b0108f43a1cb118b1e2fae902c31b2a9969.tar.gz
MLBEDSW-7019: Update to elementwise cascading
- The cascade builder is using the ifm_ifm2_correct_order function in order to decide if the operator is cascadable or not. The problem is that this function expects a full shape or no shape and the cascade builder did not provide that, so the operator was reported to be non cascadable. - The fix is to provide a full 4D shape, also refactoring ifm_ifm2_correct_order to use 4D shape to avoid confusion in the future. - Refactoring code so that the scheduler can perform a correct ifm and ifm2 swap. Signed-off-by: Johan Alfven <johan.alfven@arm.com> Change-Id: I9a86c4690612f332afa428456a07e67698852495
Diffstat (limited to 'ethosu/vela/operation_util.py')
-rw-r--r--ethosu/vela/operation_util.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ethosu/vela/operation_util.py b/ethosu/vela/operation_util.py
index aaabddbf..c4176d96 100644
--- a/ethosu/vela/operation_util.py
+++ b/ethosu/vela/operation_util.py
@@ -242,8 +242,8 @@ def create_binary_elementwise(
if ifm2 is None:
ofm_shape = ifm_shape
else:
- in_shape = [] if ifm.shape == [] else ifm_shape.as_list()
- in2_shape = [] if ifm2.shape == [] else ifm2_shape.as_list()
+ in_shape = None if ifm.shape == [] else ifm_shape
+ in2_shape = None if ifm2.shape == [] else ifm2_shape
ofm_shape = ifm_shape if ifm_ifm2_correct_order(in_shape, in2_shape) else ifm2_shape
ofm = Tensor(ofm_shape.as_list(), dtype, f"{op.name}_tens0")