diff options
author | Henrik G Olsson <henrik.olsson@arm.com> | 2021-04-09 10:51:33 +0200 |
---|---|---|
committer | patrik.gustavsson <patrik.gustavsson@arm.com> | 2021-04-09 12:40:45 +0000 |
commit | 1c772e43434bd39aad1cb2e0036dcdf67b038633 (patch) | |
tree | ba1707c43acf7305b3b13159235da8c3eb32bde3 /ethosu | |
parent | b8f400bbe963e75356ab619461bdceb8cc9568a9 (diff) | |
download | ethos-u-vela-1c772e43434bd39aad1cb2e0036dcdf67b038633.tar.gz |
MLBEDSW-4073 Handle elementwise ops with same tensor for both inputs
Signed-off-by: Henrik G Olsson <henrik.olsson@arm.com>
Change-Id: I0e6bb46b7b91ed10f5bda34fba66d8b714560f47
Diffstat (limited to 'ethosu')
-rw-r--r-- | ethosu/vela/high_level_command_stream_generator.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ethosu/vela/high_level_command_stream_generator.py b/ethosu/vela/high_level_command_stream_generator.py index aad3783d..c01790a4 100644 --- a/ethosu/vela/high_level_command_stream_generator.py +++ b/ethosu/vela/high_level_command_stream_generator.py @@ -46,7 +46,12 @@ def generate_high_level_command_stream_for_pass(strat, passes, block_configs, id npu_block_type = ps.npu_block_type split_offsets = list(ps.primary_op.read_offsets) # offset for [ifm, ifm2] - if ps.ifm_tensor is not None and ps.ifm2_tensor is not None and npu_block_type == NpuBlockType.ElementWise: + if ( + len(ps.inputs) == 2 + and ps.ifm_tensor is not None + and ps.ifm2_tensor is not None + and npu_block_type == NpuBlockType.ElementWise + ): # Ensure correct ifm and ifm2 order if ps.inputs[0] == ps.primary_op.inputs[1] and ps.inputs[1] == ps.primary_op.inputs[0]: ps.ifm_tensor, ps.ifm2_tensor = ps.ifm2_tensor, ps.ifm_tensor |