NNXSW-1826 OptimizeConsecutiveReshapes: remove unnecessary call to MoveAllConnections
authorRob Hughes <robert.hughes@arm.com>
Mon, 23 Sep 2019 15:31:28 +0000 (16:31 +0100)
committerÁron Virginás-Tar <aron.virginas-tar@arm.com>
Tue, 24 Sep 2019 13:32:53 +0000 (13:32 +0000)
This is called at a time when newReshape has nothing connected to
its output slot (as it has just been created) and so is a no-op.

The code comment indicated that the intention was to connect the newReshape
to its *input*, but that has already been done in the InsertNewLayer() call
above, so the comment was incorrect.

There is a unit test covering this case ("OptimizeConsecutiveReshapesTest")

Change-Id: I933d5d1c6eb32f5a8269fb5d7c809cd7c89680d1
Signed-off-by: Rob Hughes <robert.hughes@arm.com>
src/armnn/optimizations/OptimizeConsecutiveReshapes.hpp

index 5047d5d..f2dd7d2 100644 (file)
@@ -37,8 +37,6 @@ public:
             auto& newReshape = *graph.InsertNewLayer<ReshapeLayer>(base.GetInputSlot(0), descriptor, name.c_str());
             // Sets tensor info for new layer.
             newReshape.GetOutputHandler().SetTensorInfo(outInfo);
-            // Reconnects base with original parent.
-            newReshape.GetOutputSlot().MoveAllConnections(*parentOut);
             // Parent is now the new layer.
             parentOut = &newReshape.GetOutputSlot();
         }