Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 1 | // |
Tracy Narine | bb8d759 | 2023-07-13 16:50:54 +0100 | [diff] [blame] | 2 | // Copyright © 2019-2023 Arm Ltd. All rights reserved. |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include "SchemaSerialize.hpp" |
Colm Donelan | c42a987 | 2022-02-02 16:35:09 +0000 | [diff] [blame] | 9 | #include <armnnTestUtils/TensorHelpers.hpp> |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 10 | |
| 11 | #include "flatbuffers/idl.h" |
| 12 | #include "flatbuffers/util.h" |
| 13 | |
Matthew Bentham | 268509a | 2019-02-25 13:58:24 +0000 | [diff] [blame] | 14 | #include <ArmnnSchema_generated.h> |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 15 | #include <armnn/IRuntime.hpp> |
| 16 | #include <armnnDeserializer/IDeserializer.hpp> |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 17 | #include <armnn/utility/Assert.hpp> |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 18 | #include <armnn/utility/IgnoreUnused.hpp> |
| 19 | #include <ResolveType.hpp> |
| 20 | |
Colm Donelan | 5b5c222 | 2020-09-09 12:48:16 +0100 | [diff] [blame] | 21 | #include <fmt/format.h> |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 22 | #include <doctest/doctest.h> |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 23 | |
Sadik Armagan | 483c811 | 2021-06-01 09:24:52 +0100 | [diff] [blame] | 24 | #include <vector> |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 25 | |
Derek Lamberti | 0028d1b | 2019-02-20 13:57:42 +0000 | [diff] [blame] | 26 | using armnnDeserializer::IDeserializer; |
Matthew Bentham | 268509a | 2019-02-25 13:58:24 +0000 | [diff] [blame] | 27 | using TensorRawPtr = armnnSerializer::TensorInfo*; |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 28 | |
| 29 | struct ParserFlatbuffersSerializeFixture |
| 30 | { |
| 31 | ParserFlatbuffersSerializeFixture() : |
Derek Lamberti | 0028d1b | 2019-02-20 13:57:42 +0000 | [diff] [blame] | 32 | m_Parser(IDeserializer::Create()), |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 33 | m_Runtime(armnn::IRuntime::Create(armnn::IRuntime::CreationOptions())), |
| 34 | m_NetworkIdentifier(-1) |
| 35 | { |
| 36 | } |
| 37 | |
| 38 | std::vector<uint8_t> m_GraphBinary; |
| 39 | std::string m_JsonString; |
Derek Lamberti | 0028d1b | 2019-02-20 13:57:42 +0000 | [diff] [blame] | 40 | std::unique_ptr<IDeserializer, void (*)(IDeserializer* parser)> m_Parser; |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 41 | armnn::IRuntimePtr m_Runtime; |
| 42 | armnn::NetworkId m_NetworkIdentifier; |
| 43 | |
| 44 | /// If the single-input-single-output overload of Setup() is called, these will store the input and output name |
| 45 | /// so they don't need to be passed to the single-input-single-output overload of RunTest(). |
| 46 | std::string m_SingleInputName; |
| 47 | std::string m_SingleOutputName; |
| 48 | |
| 49 | void Setup() |
| 50 | { |
| 51 | bool ok = ReadStringToBinary(); |
| 52 | if (!ok) |
| 53 | { |
| 54 | throw armnn::Exception("LoadNetwork failed while reading binary input"); |
| 55 | } |
| 56 | |
| 57 | armnn::INetworkPtr network = |
| 58 | m_Parser->CreateNetworkFromBinary(m_GraphBinary); |
| 59 | |
| 60 | if (!network) |
| 61 | { |
| 62 | throw armnn::Exception("The parser failed to create an ArmNN network"); |
| 63 | } |
| 64 | |
| 65 | auto optimized = Optimize(*network, {armnn::Compute::CpuRef}, |
| 66 | m_Runtime->GetDeviceSpec()); |
| 67 | |
| 68 | std::string errorMessage; |
Mike Kelly | a9c3267 | 2023-12-04 17:23:09 +0000 | [diff] [blame] | 69 | armnn::Status ret = m_Runtime->LoadNetwork(m_NetworkIdentifier, std::move(optimized), errorMessage); |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 70 | |
| 71 | if (ret != armnn::Status::Success) |
| 72 | { |
Colm Donelan | 5b5c222 | 2020-09-09 12:48:16 +0100 | [diff] [blame] | 73 | throw armnn::Exception(fmt::format("The runtime failed to load the network. " |
| 74 | "Error was: {0}. in {1} [{2}:{3}]", |
| 75 | errorMessage, |
| 76 | __func__, |
| 77 | __FILE__, |
| 78 | __LINE__)); |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | } |
| 82 | |
| 83 | void SetupSingleInputSingleOutput(const std::string& inputName, const std::string& outputName) |
| 84 | { |
| 85 | // Store the input and output name so they don't need to be passed to the single-input-single-output RunTest(). |
| 86 | m_SingleInputName = inputName; |
| 87 | m_SingleOutputName = outputName; |
| 88 | Setup(); |
| 89 | } |
| 90 | |
| 91 | bool ReadStringToBinary() |
| 92 | { |
| 93 | std::string schemafile(&deserialize_schema_start, &deserialize_schema_end); |
| 94 | |
| 95 | // parse schema first, so we can use it to parse the data after |
| 96 | flatbuffers::Parser parser; |
| 97 | |
| 98 | bool ok = parser.Parse(schemafile.c_str()); |
Colm Donelan | d963603 | 2022-02-04 10:56:12 +0000 | [diff] [blame] | 99 | CHECK_MESSAGE(ok, std::string("Failed to parse schema file. Error was: " + parser.error_).c_str()); |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 100 | |
| 101 | ok &= parser.Parse(m_JsonString.c_str()); |
Colm Donelan | d963603 | 2022-02-04 10:56:12 +0000 | [diff] [blame] | 102 | CHECK_MESSAGE(ok, std::string("Failed to parse json input. Error was: " + parser.error_).c_str()); |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 103 | |
| 104 | if (!ok) |
| 105 | { |
| 106 | return false; |
| 107 | } |
| 108 | |
| 109 | { |
| 110 | const uint8_t* bufferPtr = parser.builder_.GetBufferPointer(); |
| 111 | size_t size = static_cast<size_t>(parser.builder_.GetSize()); |
| 112 | m_GraphBinary.assign(bufferPtr, bufferPtr+size); |
| 113 | } |
| 114 | return ok; |
| 115 | } |
| 116 | |
| 117 | /// Executes the network with the given input tensor and checks the result against the given output tensor. |
| 118 | /// This overload assumes the network has a single input and a single output. |
Nattapat Chaimanowong | 9066d3c | 2019-02-27 17:27:16 +0000 | [diff] [blame] | 119 | template<std::size_t NumOutputDimensions, |
| 120 | armnn::DataType ArmnnType, |
| 121 | typename DataType = armnn::ResolveType<ArmnnType>> |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 122 | void RunTest(unsigned int layersId, |
| 123 | const std::vector<DataType>& inputData, |
| 124 | const std::vector<DataType>& expectedOutputData); |
| 125 | |
Nattapat Chaimanowong | 9066d3c | 2019-02-27 17:27:16 +0000 | [diff] [blame] | 126 | template<std::size_t NumOutputDimensions, |
| 127 | armnn::DataType ArmnnInputType, |
| 128 | armnn::DataType ArmnnOutputType, |
| 129 | typename InputDataType = armnn::ResolveType<ArmnnInputType>, |
| 130 | typename OutputDataType = armnn::ResolveType<ArmnnOutputType>> |
| 131 | void RunTest(unsigned int layersId, |
| 132 | const std::vector<InputDataType>& inputData, |
| 133 | const std::vector<OutputDataType>& expectedOutputData); |
| 134 | |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 135 | /// Executes the network with the given input tensors and checks the results against the given output tensors. |
| 136 | /// This overload supports multiple inputs and multiple outputs, identified by name. |
Nattapat Chaimanowong | 9066d3c | 2019-02-27 17:27:16 +0000 | [diff] [blame] | 137 | template<std::size_t NumOutputDimensions, |
| 138 | armnn::DataType ArmnnType, |
| 139 | typename DataType = armnn::ResolveType<ArmnnType>> |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 140 | void RunTest(unsigned int layersId, |
| 141 | const std::map<std::string, std::vector<DataType>>& inputData, |
| 142 | const std::map<std::string, std::vector<DataType>>& expectedOutputData); |
| 143 | |
Nattapat Chaimanowong | 9066d3c | 2019-02-27 17:27:16 +0000 | [diff] [blame] | 144 | template<std::size_t NumOutputDimensions, |
| 145 | armnn::DataType ArmnnInputType, |
| 146 | armnn::DataType ArmnnOutputType, |
| 147 | typename InputDataType = armnn::ResolveType<ArmnnInputType>, |
| 148 | typename OutputDataType = armnn::ResolveType<ArmnnOutputType>> |
| 149 | void RunTest(unsigned int layersId, |
| 150 | const std::map<std::string, std::vector<InputDataType>>& inputData, |
| 151 | const std::map<std::string, std::vector<OutputDataType>>& expectedOutputData); |
| 152 | |
Tracy Narine | bb8d759 | 2023-07-13 16:50:54 +0100 | [diff] [blame] | 153 | template<std::size_t NumOutputDimensions, |
| 154 | armnn::DataType ArmnnInputType0, |
| 155 | armnn::DataType ArmnnInputType1, |
| 156 | armnn::DataType ArmnnOutputType, |
| 157 | typename InputDataType0 = armnn::ResolveType<ArmnnInputType0>, |
| 158 | typename InputDataType1 = armnn::ResolveType<ArmnnInputType1>, |
| 159 | typename OutputDataType = armnn::ResolveType<ArmnnOutputType>> |
| 160 | void RunTest(unsigned int layersId, |
| 161 | const std::map<std::string, std::vector<InputDataType0>>& inputData0, |
| 162 | const std::map<std::string, std::vector<InputDataType1>>& inputData1, |
| 163 | const std::map<std::string, std::vector<OutputDataType>>& expectedOutputData); |
| 164 | |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 165 | void CheckTensors(const TensorRawPtr& tensors, size_t shapeSize, const std::vector<int32_t>& shape, |
Derek Lamberti | 0028d1b | 2019-02-20 13:57:42 +0000 | [diff] [blame] | 166 | armnnSerializer::TensorInfo tensorType, const std::string& name, |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 167 | const float scale, const int64_t zeroPoint) |
| 168 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 169 | armnn::IgnoreUnused(name); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 170 | CHECK_EQ(shapeSize, tensors->dimensions()->size()); |
| 171 | CHECK(std::equal(shape.begin(), shape.end(), |
| 172 | tensors->dimensions()->begin(), tensors->dimensions()->end())); |
| 173 | CHECK_EQ(tensorType.dataType(), tensors->dataType()); |
| 174 | CHECK_EQ(scale, tensors->quantizationScale()); |
| 175 | CHECK_EQ(zeroPoint, tensors->quantizationOffset()); |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 176 | } |
| 177 | }; |
| 178 | |
Nattapat Chaimanowong | 9066d3c | 2019-02-27 17:27:16 +0000 | [diff] [blame] | 179 | template<std::size_t NumOutputDimensions, armnn::DataType ArmnnType, typename DataType> |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 180 | void ParserFlatbuffersSerializeFixture::RunTest(unsigned int layersId, |
| 181 | const std::vector<DataType>& inputData, |
| 182 | const std::vector<DataType>& expectedOutputData) |
| 183 | { |
Nattapat Chaimanowong | 9066d3c | 2019-02-27 17:27:16 +0000 | [diff] [blame] | 184 | RunTest<NumOutputDimensions, ArmnnType, ArmnnType, DataType, DataType>(layersId, inputData, expectedOutputData); |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 185 | } |
| 186 | |
Nattapat Chaimanowong | 9066d3c | 2019-02-27 17:27:16 +0000 | [diff] [blame] | 187 | template<std::size_t NumOutputDimensions, |
| 188 | armnn::DataType ArmnnInputType, |
| 189 | armnn::DataType ArmnnOutputType, |
| 190 | typename InputDataType, |
| 191 | typename OutputDataType> |
| 192 | void ParserFlatbuffersSerializeFixture::RunTest(unsigned int layersId, |
| 193 | const std::vector<InputDataType>& inputData, |
| 194 | const std::vector<OutputDataType>& expectedOutputData) |
| 195 | { |
| 196 | RunTest<NumOutputDimensions, ArmnnInputType, ArmnnOutputType>(layersId, |
| 197 | { { m_SingleInputName, inputData } }, |
| 198 | { { m_SingleOutputName, expectedOutputData } }); |
| 199 | } |
| 200 | |
| 201 | template<std::size_t NumOutputDimensions, armnn::DataType ArmnnType, typename DataType> |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 202 | void ParserFlatbuffersSerializeFixture::RunTest(unsigned int layersId, |
| 203 | const std::map<std::string, std::vector<DataType>>& inputData, |
| 204 | const std::map<std::string, std::vector<DataType>>& expectedOutputData) |
| 205 | { |
Nattapat Chaimanowong | 9066d3c | 2019-02-27 17:27:16 +0000 | [diff] [blame] | 206 | RunTest<NumOutputDimensions, ArmnnType, ArmnnType, DataType, DataType>(layersId, inputData, expectedOutputData); |
| 207 | } |
| 208 | |
| 209 | template<std::size_t NumOutputDimensions, |
| 210 | armnn::DataType ArmnnInputType, |
| 211 | armnn::DataType ArmnnOutputType, |
| 212 | typename InputDataType, |
| 213 | typename OutputDataType> |
| 214 | void ParserFlatbuffersSerializeFixture::RunTest( |
| 215 | unsigned int layersId, |
| 216 | const std::map<std::string, std::vector<InputDataType>>& inputData, |
| 217 | const std::map<std::string, std::vector<OutputDataType>>& expectedOutputData) |
| 218 | { |
Derek Lamberti | 8ddae33 | 2019-02-21 16:29:43 +0000 | [diff] [blame] | 219 | auto ConvertBindingInfo = [](const armnnDeserializer::BindingPointInfo& bindingInfo) |
| 220 | { |
| 221 | return std::make_pair(bindingInfo.m_BindingId, bindingInfo.m_TensorInfo); |
| 222 | }; |
| 223 | |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 224 | // Setup the armnn input tensors from the given vectors. |
| 225 | armnn::InputTensors inputTensors; |
| 226 | for (auto&& it : inputData) |
| 227 | { |
Jim Flynn | b4d7eae | 2019-05-01 14:44:27 +0100 | [diff] [blame] | 228 | armnn::BindingPointInfo bindingInfo = ConvertBindingInfo( |
| 229 | m_Parser->GetNetworkInputBindingInfo(layersId, it.first)); |
Cathal Corbett | 5b8093c | 2021-10-22 11:12:07 +0100 | [diff] [blame] | 230 | bindingInfo.second.SetConstant(true); |
Nattapat Chaimanowong | 9066d3c | 2019-02-27 17:27:16 +0000 | [diff] [blame] | 231 | armnn::VerifyTensorInfoDataType(bindingInfo.second, ArmnnInputType); |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 232 | inputTensors.push_back({ bindingInfo.first, armnn::ConstTensor(bindingInfo.second, it.second.data()) }); |
| 233 | } |
| 234 | |
| 235 | // Allocate storage for the output tensors to be written to and setup the armnn output tensors. |
Sadik Armagan | 483c811 | 2021-06-01 09:24:52 +0100 | [diff] [blame] | 236 | std::map<std::string, std::vector<OutputDataType>> outputStorage; |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 237 | armnn::OutputTensors outputTensors; |
| 238 | for (auto&& it : expectedOutputData) |
| 239 | { |
Jim Flynn | b4d7eae | 2019-05-01 14:44:27 +0100 | [diff] [blame] | 240 | armnn::BindingPointInfo bindingInfo = ConvertBindingInfo( |
| 241 | m_Parser->GetNetworkOutputBindingInfo(layersId, it.first)); |
Nattapat Chaimanowong | 9066d3c | 2019-02-27 17:27:16 +0000 | [diff] [blame] | 242 | armnn::VerifyTensorInfoDataType(bindingInfo.second, ArmnnOutputType); |
Sadik Armagan | 483c811 | 2021-06-01 09:24:52 +0100 | [diff] [blame] | 243 | outputStorage.emplace(it.first, std::vector<OutputDataType>(bindingInfo.second.GetNumElements())); |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 244 | outputTensors.push_back( |
| 245 | { bindingInfo.first, armnn::Tensor(bindingInfo.second, outputStorage.at(it.first).data()) }); |
| 246 | } |
| 247 | |
| 248 | m_Runtime->EnqueueWorkload(m_NetworkIdentifier, inputTensors, outputTensors); |
| 249 | |
| 250 | // Compare each output tensor to the expected values |
| 251 | for (auto&& it : expectedOutputData) |
| 252 | { |
Jim Flynn | b4d7eae | 2019-05-01 14:44:27 +0100 | [diff] [blame] | 253 | armnn::BindingPointInfo bindingInfo = ConvertBindingInfo( |
| 254 | m_Parser->GetNetworkOutputBindingInfo(layersId, it.first)); |
Sadik Armagan | 483c811 | 2021-06-01 09:24:52 +0100 | [diff] [blame] | 255 | auto outputExpected = it.second; |
| 256 | auto result = CompareTensors(outputExpected, outputStorage[it.first], |
| 257 | bindingInfo.second.GetShape(), bindingInfo.second.GetShape()); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 258 | CHECK_MESSAGE(result.m_Result, result.m_Message.str()); |
Kevin May | 43a799c | 2019-02-08 16:31:42 +0000 | [diff] [blame] | 259 | } |
Matthew Bentham | 268509a | 2019-02-25 13:58:24 +0000 | [diff] [blame] | 260 | } |
Tracy Narine | bb8d759 | 2023-07-13 16:50:54 +0100 | [diff] [blame] | 261 | |
| 262 | template<std::size_t NumOutputDimensions, |
| 263 | armnn::DataType ArmnnInputType0, |
| 264 | armnn::DataType ArmnnInputType1, |
| 265 | armnn::DataType ArmnnOutputType, |
| 266 | typename InputDataType0, |
| 267 | typename InputDataType1, |
| 268 | typename OutputDataType> |
| 269 | void ParserFlatbuffersSerializeFixture::RunTest( |
| 270 | unsigned int layersId, |
| 271 | const std::map<std::string, std::vector<InputDataType0>>& inputData0, |
| 272 | const std::map<std::string, std::vector<InputDataType1>>& inputData1, |
| 273 | const std::map<std::string, std::vector<OutputDataType>>& expectedOutputData) |
| 274 | { |
| 275 | auto ConvertBindingInfo = [](const armnnDeserializer::BindingPointInfo& bindingInfo) |
| 276 | { |
| 277 | return std::make_pair(bindingInfo.m_BindingId, bindingInfo.m_TensorInfo); |
| 278 | }; |
| 279 | |
| 280 | // Setup the armnn input tensors from the given vectors. |
| 281 | armnn::InputTensors inputTensors; |
| 282 | for (auto&& it : inputData0) |
| 283 | { |
| 284 | armnn::BindingPointInfo bindingInfo = ConvertBindingInfo( |
| 285 | m_Parser->GetNetworkInputBindingInfo(layersId, it.first)); |
| 286 | bindingInfo.second.SetConstant(true); |
| 287 | armnn::VerifyTensorInfoDataType(bindingInfo.second, ArmnnInputType0); |
| 288 | inputTensors.push_back({ bindingInfo.first, armnn::ConstTensor(bindingInfo.second, it.second.data()) }); |
| 289 | } |
| 290 | |
| 291 | for (auto&& it : inputData1) |
| 292 | { |
| 293 | armnn::BindingPointInfo bindingInfo = ConvertBindingInfo( |
| 294 | m_Parser->GetNetworkInputBindingInfo(layersId, it.first)); |
| 295 | bindingInfo.second.SetConstant(true); |
| 296 | armnn::VerifyTensorInfoDataType(bindingInfo.second, ArmnnInputType1); |
| 297 | inputTensors.push_back({ bindingInfo.first, armnn::ConstTensor(bindingInfo.second, it.second.data()) }); |
| 298 | } |
| 299 | |
| 300 | // Allocate storage for the output tensors to be written to and setup the armnn output tensors. |
| 301 | std::map<std::string, std::vector<OutputDataType>> outputStorage; |
| 302 | armnn::OutputTensors outputTensors; |
| 303 | for (auto&& it : expectedOutputData) |
| 304 | { |
| 305 | armnn::BindingPointInfo bindingInfo = ConvertBindingInfo( |
| 306 | m_Parser->GetNetworkOutputBindingInfo(layersId, it.first)); |
| 307 | armnn::VerifyTensorInfoDataType(bindingInfo.second, ArmnnOutputType); |
| 308 | outputStorage.emplace(it.first, std::vector<OutputDataType>(bindingInfo.second.GetNumElements())); |
| 309 | outputTensors.push_back( |
| 310 | { bindingInfo.first, armnn::Tensor(bindingInfo.second, outputStorage.at(it.first).data()) }); |
| 311 | } |
| 312 | |
| 313 | m_Runtime->EnqueueWorkload(m_NetworkIdentifier, inputTensors, outputTensors); |
| 314 | |
| 315 | // Compare each output tensor to the expected values |
| 316 | for (auto&& it : expectedOutputData) |
| 317 | { |
| 318 | armnn::BindingPointInfo bindingInfo = ConvertBindingInfo( |
| 319 | m_Parser->GetNetworkOutputBindingInfo(layersId, it.first)); |
| 320 | auto outputExpected = it.second; |
| 321 | auto result = CompareTensors(outputExpected, outputStorage[it.first], |
| 322 | bindingInfo.second.GetShape(), bindingInfo.second.GetShape()); |
| 323 | CHECK_MESSAGE(result.m_Result, result.m_Message.str()); |
| 324 | } |
| 325 | } |