From 2acd618fb6c6c137d7fa6fe18c51fa1dadc53041 Mon Sep 17 00:00:00 2001 From: Sergei Barannikov/Engineer/AI Tools Lab /SRR/Samsung Electronics Date: Wed, 16 Oct 2019 00:02:41 +0300 Subject: [PATCH] [nnc] Fix unittest for CombineTransposes optimization (#8187) Get the correct IDs of Input ops. Signed-off-by: Sergei Barannikov --- compiler/nnc/unittests/optimizations/CombineTransposes.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/nnc/unittests/optimizations/CombineTransposes.cpp b/compiler/nnc/unittests/optimizations/CombineTransposes.cpp index 517755f..c6b1464 100644 --- a/compiler/nnc/unittests/optimizations/CombineTransposes.cpp +++ b/compiler/nnc/unittests/optimizations/CombineTransposes.cpp @@ -135,14 +135,14 @@ TEST(OptPass, combineTransposesOpOrder) Operation *tr3 = g.create(tr1->getOutput(0), vector{2, 1, 0}); Operation *elw = g.create(tr2->getOutput(0), tr3->getOutput(0)); g.create(elw->getOutput(0)); - int n1 = elw->getInput(0)->getNode()->getInput(0)->getNode()->getInput(0)->getNode()->getId(); - int n2 = elw->getInput(1)->getNode()->getInput(0)->getNode()->getInput(0)->getNode()->getId(); + int n1 = in1->getId(); + int n2 = in2->getId(); CombineTransposes pass; pass.run(&g); ASSERT_EQ(g.getOutputs()[0]->getInput(0)->getProducer()->getNode()->getType(), mir::Operation::Type::add); // Order is preserved - ASSERT_EQ(n1, elw->getInput(0)->getNode()->getId()); - ASSERT_EQ(n2, elw->getInput(1)->getNode()->getId()); + ASSERT_EQ(n1, elw->getInput(0)->getProducer()->getNode()->getId()); + ASSERT_EQ(n2, elw->getInput(1)->getProducer()->getNode()->getId()); } } // unnamed namespace -- 2.7.4