std::map<int, std::vector<TInput>> inputTensorData = {{ 0, input0 }, { 1, input1 }};
std::map<int, std::vector<TOutput>> expectedOutputData = {{ 0, expectedOutput }};
- EndToEndLayerTestImpl<TInput, TOutput>(move(net), inputTensorData, expectedOutputData, backends);
+ EndToEndLayerTestImpl<ArmnnInputType, ArmnnOutputType>(move(net), inputTensorData, expectedOutputData, backends);
}
template<armnn::DataType ArmnnInputType,
std::map<int, std::vector<TInput>> inputTensorData = {{ 0, input0 }, { 1, input1 }};
std::map<int, std::vector<TOutput>> expectedOutputData = {{ 0, expectedOutput }};
- EndToEndLayerTestImpl<TInput, TOutput>(move(net), inputTensorData, expectedOutputData, backends);
+ EndToEndLayerTestImpl<ArmnnInputType, ArmnnOutputType>(move(net), inputTensorData, expectedOutputData, backends);
}
} // anonymous namespace
//
#pragma once
+#include "TypeUtils.hpp"
+
#include <armnn/ArmNN.hpp>
#include <armnn/INetwork.hpp>
);
}
-template<typename TInput, typename TOutput>
+template<typename T>
+bool CompareBoolean(T a, T b)
+{
+ return (a == 0 && b == 0) ||(a != 0 && b != 0);
+};
+
+template<DataType ArmnnIType, DataType ArmnnOType,
+ typename TInput = ResolveType<ArmnnIType>, typename TOutput = ResolveType<ArmnnOType>>
void EndToEndLayerTestImpl(INetworkPtr network,
const std::map<int, std::vector<TInput>>& inputTensorData,
const std::map<int, std::vector<TOutput>>& expectedOutputData,
for (auto&& it : expectedOutputData)
{
std::vector<TOutput> out = outputStorage.at(it.first);
- BOOST_TEST(it.second == out);
+ if (ArmnnOType == DataType::Boolean)
+ {
+ for (unsigned int i = 0; i < out.size(); ++i)
+ {
+ BOOST_TEST(CompareBoolean<TOutput>(it.second[i], out[i]));
+ }
+ }
+ else
+ {
+ BOOST_TEST(it.second == out);
+ }
}
}
-} // anonymous namespace
\ No newline at end of file
+} // anonymous namespace
std::map<int, std::vector<T>> inputTensorData = {{ 0, paramsData }};
std::map<int, std::vector<T>> expectedOutputData = {{ 0, expectedOutput }};
- EndToEndLayerTestImpl<T>(move(net), inputTensorData, expectedOutputData, backends);
+ EndToEndLayerTestImpl<ArmnnType, ArmnnType>(move(net), inputTensorData, expectedOutputData, backends);
}
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
std::map<int, std::vector<T>> inputTensorData = {{ 0, paramsData }};
std::map<int, std::vector<T>> expectedOutputData = {{ 0, expectedOutput }};
- EndToEndLayerTestImpl<T>(move(net), inputTensorData, expectedOutputData, backends);
+ EndToEndLayerTestImpl<ArmnnType, ArmnnType>(move(net), inputTensorData, expectedOutputData, backends);
}
-} // anonymous namespace
\ No newline at end of file
+} // anonymous namespace
std::map<int, std::vector<T>> inputTensorData = {{ 0,inputData }, { 1,inputData }};
std::map<int, std::vector<T>> expectedOutputData = {{ 0,expectedOutput }};
- EndToEndLayerTestImpl<T, T>(move(net), inputTensorData, expectedOutputData, backends);
+ EndToEndLayerTestImpl<ArmnnType, ArmnnType>(move(net), inputTensorData, expectedOutputData, backends);
}
template<armnn::DataType ArmnnType>
std::map<int, std::vector<T>> inputTensorData = {{ 0,inputData }, { 1,inputData }};
std::map<int, std::vector<T>> expectedOutputData = {{ 0,expectedOutput }};
- EndToEndLayerTestImpl<T>(move(net), inputTensorData, expectedOutputData, backends);
+ EndToEndLayerTestImpl<ArmnnType, ArmnnType>(move(net), inputTensorData, expectedOutputData, backends);
}
template<armnn::DataType ArmnnType>
std::map<int, std::vector<T>> inputTensorData = {{ 0,inputData }, { 1,inputData }};
std::map<int, std::vector<T>> expectedOutputData = {{ 0,expectedOutput }};
- EndToEndLayerTestImpl<T>(move(net), inputTensorData, expectedOutputData, backends);
+ EndToEndLayerTestImpl<ArmnnType, ArmnnType>(move(net), inputTensorData, expectedOutputData, backends);
}
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
std::map<int, std::vector<T>> inputTensorData = {{ 0,inputData }, { 1,inputData }};
std::map<int, std::vector<T>> expectedOutputData = {{ 0,expectedOutput }};
- EndToEndLayerTestImpl<T>(move(net), inputTensorData, expectedOutputData, backends);
+ EndToEndLayerTestImpl<ArmnnType, ArmnnType>(move(net), inputTensorData, expectedOutputData, backends);
}
} // anonymous namespace