MCPcopy Create free account
hub / github.com/ARM-software/armnn / FullyConnectedInt8Test

Function FullyConnectedInt8Test

delegate/test/FullyConnectedTest.cpp:65–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65void FullyConnectedInt8Test(const std::vector<armnn::BackendId>& backends = {}, bool constantWeights = true)
66{
67 std::vector<int32_t> inputTensorShape { 1, 4, 2, 1 };
68 std::vector<int32_t> weightsTensorShape { 1, 4 };
69 std::vector<int32_t> biasTensorShape { 1 };
70 std::vector<int32_t> outputTensorShape { 2, 1 };
71
72 std::vector<int8_t> inputValues = { 1, 2, 3, 4, 5, 10, 15, 20 };
73 std::vector<int8_t> weightsData = { 2, 3, 4, 5 };
74
75 std::vector<int8_t> expectedOutputValues = { 25, 105 }; // (40 + 10) / 2, (200 + 10) / 2
76
77 // bias is set std::vector<int32_t> biasData = { 10 } in the model
78 // input and weights quantization scale 1.0f and offset 0 in the model
79 // output quantization scale 2.0f and offset 0 in the model
80 FullyConnectedTest<int8_t>(::tflite::TensorType_INT8,
81 tflite::ActivationFunctionType_NONE,
82 inputTensorShape,
83 weightsTensorShape,
84 biasTensorShape,
85 outputTensorShape,
86 inputValues,
87 expectedOutputValues,
88 weightsData,
89 backends,
90 constantWeights);
91}
92
93TEST_SUITE("FullyConnectedTests")
94{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected