83 TEST_CASE(
"PerAxisIteratorTest1")
85 std::vector<int8_t> input = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
86 TensorInfo tensorInfo ({3,1,2,2},DataType::QSymmS8);
89 std::vector<int8_t> expOutput = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
90 auto iterator = MockPerAxisIterator(input.data(), tensorInfo.GetShape(), 0);
91 std::vector<int8_t> output = iterator.Loop();
96 CHECK(iterator.GetAxisIndex() == 1u);
99 CHECK(iterator.GetAxisIndex() == 0u);
102 CHECK(iterator.GetAxisIndex() == 2u);
106 TEST_CASE(
"PerAxisIteratorTest2")
108 std::vector<int8_t> input = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
109 TensorInfo tensorInfo ({3,1,2,2},DataType::QSymmS8);
112 std::vector<int8_t> expOutput = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
113 auto iterator = MockPerAxisIterator(input.data(), tensorInfo.GetShape(), 1);
114 std::vector<int8_t> output = iterator.Loop();
119 CHECK(iterator.GetAxisIndex() == 0u);
122 CHECK(iterator.GetAxisIndex() == 0u);
125 CHECK(iterator.GetAxisIndex() == 0u);
129 TEST_CASE(
"PerAxisIteratorTest3")
131 std::vector<int8_t> input = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
132 TensorInfo tensorInfo ({3,1,2,2},DataType::QSymmS8);
135 std::vector<int8_t> expOutput = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
136 auto iterator = MockPerAxisIterator(input.data(), tensorInfo.GetShape(), 2);
137 std::vector<int8_t> output = iterator.Loop();
142 CHECK(iterator.GetAxisIndex() == 0u);
145 CHECK(iterator.GetAxisIndex() == 0u);
148 CHECK(iterator.GetAxisIndex() == 1u);
152 TEST_CASE(
"PerAxisIteratorTest4")
154 std::vector<int8_t> input = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
155 TensorInfo tensorInfo ({3,1,2,2},DataType::QSymmS8);
158 std::vector<int8_t> expOutput = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
159 auto iterator = MockPerAxisIterator(input.data(), tensorInfo.GetShape(), 3);
160 std::vector<int8_t> output = iterator.Loop();
165 CHECK(iterator.GetAxisIndex() == 1u);
168 CHECK(iterator.GetAxisIndex() == 1u);
171 CHECK(iterator.GetAxisIndex() == 0u);
175 TEST_CASE(
"PerAxisIteratorTest5")
177 using namespace armnn;
178 std::vector<int8_t> input =
186 std::vector<int8_t> expOutput =
195 auto iterator = MockPerAxisIterator(input.data(), tensorInfo.GetShape(), 1);
196 std::vector<int8_t> output = iterator.Loop();
201 CHECK(iterator.GetAxisIndex() == 1u);
204 CHECK(iterator.GetAxisIndex() == 0u);
207 CHECK(iterator.GetAxisIndex() == 0u);
211 TEST_CASE(
"PerAxisIteratorTest7")
213 using namespace armnn;
214 std::vector<int8_t> input =
221 std::vector<int8_t> expOutput =
229 auto iterator = MockPerAxisIterator(input.data(), tensorInfo.GetShape(), 2);
232 CHECK(iterator.Get() == expOutput[3]);
233 CHECK(iterator.GetAxisIndex() == 1u);
236 CHECK(iterator.Get() == expOutput[6]);
237 CHECK(iterator.GetAxisIndex() == 1u);
240 CHECK(iterator.Get() == expOutput[4]);
241 CHECK(iterator.GetAxisIndex() == 0u);
244 CHECK(iterator.Get() == expOutput[3]);
245 CHECK(iterator.GetAxisIndex() == 1u);
void CompareVector(std::vector< T > vec1, std::vector< T > vec2)
Copyright (c) 2021 ARM Limited and Contributors.