From 623266c251de2ab38da7b79ce853d447d1951a4f Mon Sep 17 00:00:00 2001 From: Yaman Umuroglu <maltanar@gmail.com> Date: Mon, 18 May 2020 23:59:24 +0100 Subject: [PATCH] [Transform] comment MoveScalarLinearPastEltwiseAdd --- src/finn/transformation/streamline/reorder.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/finn/transformation/streamline/reorder.py b/src/finn/transformation/streamline/reorder.py index 1cee575f2..254f9ab0e 100644 --- a/src/finn/transformation/streamline/reorder.py +++ b/src/finn/transformation/streamline/reorder.py @@ -272,7 +272,12 @@ class MoveScalarMulPastConv(Transformation): class MoveScalarLinearPastEltwiseAdd(Transformation): - """Move scalar linear operations (mul, add) past elementwise operations.""" + """Move scalar linear operations (mul, add) past elementwise add operations where possible. Specifically, + matches and transforms the following patterns: + (x*C) + (y*C) -> (x + y) * C + (x+A) + (y+B) -> (x + y) + (A + B) + where x and y are dynamic inputs, A, B, C are constants. + """ def move_node(self, graph, n, prod0, prod1, node_ind): # found! move one of the muls to output, remove the other one -- GitLab