From 907cb03bb73ce590b044947b0981ceb25e8c3430 Mon Sep 17 00:00:00 2001 From: Tim Hall Date: Tue, 10 Nov 2020 19:58:59 +0000 Subject: vela: Tanh and Sigmoid broken in fixup_act_reorder - Fixed bug due to typo in Op.type refactor Signed-off-by: Tim Hall Change-Id: I55916d90bf792648f496a45c358b7e897c6730ba --- ethosu/vela/graph_optimiser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ethosu') diff --git a/ethosu/vela/graph_optimiser.py b/ethosu/vela/graph_optimiser.py index 4f473ddb..7401927d 100644 --- a/ethosu/vela/graph_optimiser.py +++ b/ethosu/vela/graph_optimiser.py @@ -322,7 +322,7 @@ def convert_batched_fc_shape(op, arch, nng): ifm = op.inputs[0] ofm = op.outputs[0] # Check if the FC is 2D and first dimension indicates batching - if len(ifm.shape) == len(ofm.shape) == 2 and ifm.shape[0] != 1: + if len(ifm.shape) == len(ofm.shape) == 2 and ifm.shape[0] > 1: n = ifm.shape[0] batching_split = {4: (2, 2), 8: (2, 4), 16: (4, 4)} h, w = batching_split.get(n, (1, n)) @@ -649,7 +649,7 @@ def fixup_relus_with_differing_ifm_ofm_scaling(op, arch, nng): # Reorder activation op if it's after the memory only operations def fixup_act_reorder(op, arch, nng): - if op.type.is_relu_op() or op in set((Op.Sigmoid, Op.Tanh)): + if op.type.is_relu_op() or op.type in set((Op.Sigmoid, Op.Tanh)): prep_op = get_prepend_op(op) if prep_op is not None: act_op = op.clone("_reordered") -- cgit v1.2.1