Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 1 | /* |
Isabella Gottardi | 0ae5de9 | 2019-03-14 10:32:11 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2019 ARM Limited. |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
Georgios Pinitas | f52cd78 | 2019-03-25 14:06:14 +0000 | [diff] [blame] | 24 | #ifndef __ARM_COMPUTE_UTILS_GRAPH_UTILS_H__ |
| 25 | #define __ARM_COMPUTE_UTILS_GRAPH_UTILS_H__ |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 26 | |
Michalis Spyrou | 53b405f | 2017-09-27 15:55:31 +0100 | [diff] [blame] | 27 | #include "arm_compute/core/PixelValue.h" |
Gian Marco Iodice | ad486e2 | 2018-08-07 17:17:06 +0100 | [diff] [blame] | 28 | #include "arm_compute/core/Utils.h" |
Isabella Gottardi | 88d5b22 | 2018-04-06 12:24:55 +0100 | [diff] [blame] | 29 | #include "arm_compute/core/utils/misc/Utility.h" |
Gian Marco | bfa3b52 | 2017-12-12 10:08:38 +0000 | [diff] [blame] | 30 | #include "arm_compute/graph/Graph.h" |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 31 | #include "arm_compute/graph/ITensorAccessor.h" |
| 32 | #include "arm_compute/graph/Types.h" |
Isabella Gottardi | 88d5b22 | 2018-04-06 12:24:55 +0100 | [diff] [blame] | 33 | #include "arm_compute/runtime/Tensor.h" |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 34 | |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 35 | #include "utils/CommonGraphOptions.h" |
| 36 | |
Georgios Pinitas | 140fdc7 | 2018-02-16 11:42:38 +0000 | [diff] [blame] | 37 | #include <array> |
Michalis Spyrou | 53b405f | 2017-09-27 15:55:31 +0100 | [diff] [blame] | 38 | #include <random> |
Gian Marco | 44ec2e7 | 2017-10-19 14:13:38 +0100 | [diff] [blame] | 39 | #include <string> |
| 40 | #include <vector> |
Michalis Spyrou | 53b405f | 2017-09-27 15:55:31 +0100 | [diff] [blame] | 41 | |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 42 | namespace arm_compute |
| 43 | { |
| 44 | namespace graph_utils |
| 45 | { |
Georgios Pinitas | 140fdc7 | 2018-02-16 11:42:38 +0000 | [diff] [blame] | 46 | /** Preprocessor interface **/ |
| 47 | class IPreprocessor |
| 48 | { |
| 49 | public: |
Alex Gilday | c357c47 | 2018-03-21 13:54:09 +0000 | [diff] [blame] | 50 | /** Default destructor. */ |
| 51 | virtual ~IPreprocessor() = default; |
| 52 | /** Preprocess the given tensor. |
| 53 | * |
| 54 | * @param[in] tensor Tensor to preprocess. |
| 55 | */ |
Georgios Pinitas | 140fdc7 | 2018-02-16 11:42:38 +0000 | [diff] [blame] | 56 | virtual void preprocess(ITensor &tensor) = 0; |
| 57 | }; |
| 58 | |
| 59 | /** Caffe preproccessor */ |
| 60 | class CaffePreproccessor : public IPreprocessor |
| 61 | { |
| 62 | public: |
| 63 | /** Default Constructor |
| 64 | * |
Georgios Pinitas | b54c644 | 2019-04-03 13:18:14 +0100 | [diff] [blame] | 65 | * @param[in] mean Mean array in RGB ordering |
| 66 | * @param[in] bgr Boolean specifying if the preprocessing should assume BGR format |
| 67 | * @param[in] scale Scale value |
Georgios Pinitas | 140fdc7 | 2018-02-16 11:42:38 +0000 | [diff] [blame] | 68 | */ |
Georgios Pinitas | b54c644 | 2019-04-03 13:18:14 +0100 | [diff] [blame] | 69 | CaffePreproccessor(std::array<float, 3> mean = std::array<float, 3> { { 0, 0, 0 } }, bool bgr = true, float scale = 1.f); |
Georgios Pinitas | 140fdc7 | 2018-02-16 11:42:38 +0000 | [diff] [blame] | 70 | void preprocess(ITensor &tensor) override; |
| 71 | |
| 72 | private: |
giuros01 | 351bd13 | 2019-08-23 14:27:30 +0100 | [diff] [blame] | 73 | template <typename T> |
| 74 | void preprocess_typed(ITensor &tensor); |
| 75 | |
Georgios Pinitas | 140fdc7 | 2018-02-16 11:42:38 +0000 | [diff] [blame] | 76 | std::array<float, 3> _mean; |
Pablo Tello | 3252143 | 2018-11-15 14:43:10 +0000 | [diff] [blame] | 77 | bool _bgr; |
Georgios Pinitas | b54c644 | 2019-04-03 13:18:14 +0100 | [diff] [blame] | 78 | float _scale; |
Georgios Pinitas | 140fdc7 | 2018-02-16 11:42:38 +0000 | [diff] [blame] | 79 | }; |
| 80 | |
| 81 | /** TF preproccessor */ |
| 82 | class TFPreproccessor : public IPreprocessor |
| 83 | { |
| 84 | public: |
Georgios Pinitas | be2772a | 2018-08-17 15:33:39 +0100 | [diff] [blame] | 85 | /** Constructor |
| 86 | * |
| 87 | * @param[in] min_range Min normalization range. (Defaults to -1.f) |
| 88 | * @param[in] max_range Max normalization range. (Defaults to 1.f) |
| 89 | */ |
| 90 | TFPreproccessor(float min_range = -1.f, float max_range = 1.f); |
| 91 | |
| 92 | // Inherited overriden methods |
Georgios Pinitas | 140fdc7 | 2018-02-16 11:42:38 +0000 | [diff] [blame] | 93 | void preprocess(ITensor &tensor) override; |
Georgios Pinitas | be2772a | 2018-08-17 15:33:39 +0100 | [diff] [blame] | 94 | |
| 95 | private: |
giuros01 | 351bd13 | 2019-08-23 14:27:30 +0100 | [diff] [blame] | 96 | template <typename T> |
| 97 | void preprocess_typed(ITensor &tensor); |
| 98 | |
Georgios Pinitas | be2772a | 2018-08-17 15:33:39 +0100 | [diff] [blame] | 99 | float _min_range; |
| 100 | float _max_range; |
Georgios Pinitas | 140fdc7 | 2018-02-16 11:42:38 +0000 | [diff] [blame] | 101 | }; |
| 102 | |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 103 | /** PPM writer class */ |
| 104 | class PPMWriter : public graph::ITensorAccessor |
| 105 | { |
| 106 | public: |
| 107 | /** Constructor |
| 108 | * |
| 109 | * @param[in] name PPM file name |
| 110 | * @param[in] maximum Maximum elements to access |
| 111 | */ |
| 112 | PPMWriter(std::string name, unsigned int maximum = 1); |
| 113 | /** Allows instances to move constructed */ |
| 114 | PPMWriter(PPMWriter &&) = default; |
| 115 | |
| 116 | // Inherited methods overriden: |
| 117 | bool access_tensor(ITensor &tensor) override; |
| 118 | |
| 119 | private: |
| 120 | const std::string _name; |
| 121 | unsigned int _iterator; |
| 122 | unsigned int _maximum; |
| 123 | }; |
| 124 | |
| 125 | /** Dummy accessor class */ |
Michalis Spyrou | 53b405f | 2017-09-27 15:55:31 +0100 | [diff] [blame] | 126 | class DummyAccessor final : public graph::ITensorAccessor |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 127 | { |
| 128 | public: |
| 129 | /** Constructor |
| 130 | * |
| 131 | * @param[in] maximum Maximum elements to write |
| 132 | */ |
| 133 | DummyAccessor(unsigned int maximum = 1); |
| 134 | /** Allows instances to move constructed */ |
| 135 | DummyAccessor(DummyAccessor &&) = default; |
| 136 | |
| 137 | // Inherited methods overriden: |
| 138 | bool access_tensor(ITensor &tensor) override; |
| 139 | |
| 140 | private: |
| 141 | unsigned int _iterator; |
| 142 | unsigned int _maximum; |
| 143 | }; |
| 144 | |
Isabella Gottardi | 88d5b22 | 2018-04-06 12:24:55 +0100 | [diff] [blame] | 145 | /** NumPy accessor class */ |
| 146 | class NumPyAccessor final : public graph::ITensorAccessor |
| 147 | { |
| 148 | public: |
| 149 | /** Constructor |
| 150 | * |
| 151 | * @param[in] npy_path Path to npy file. |
| 152 | * @param[in] shape Shape of the numpy tensor data. |
| 153 | * @param[in] data_type DataType of the numpy tensor data. |
Isabella Gottardi | a7acb3c | 2019-01-08 13:48:44 +0000 | [diff] [blame] | 154 | * @param[in] data_layout (Optional) DataLayout of the numpy tensor data. |
Isabella Gottardi | 88d5b22 | 2018-04-06 12:24:55 +0100 | [diff] [blame] | 155 | * @param[out] output_stream (Optional) Output stream |
| 156 | */ |
Isabella Gottardi | a7acb3c | 2019-01-08 13:48:44 +0000 | [diff] [blame] | 157 | NumPyAccessor(std::string npy_path, TensorShape shape, DataType data_type, DataLayout data_layout = DataLayout::NCHW, std::ostream &output_stream = std::cout); |
Isabella Gottardi | 88d5b22 | 2018-04-06 12:24:55 +0100 | [diff] [blame] | 158 | /** Allow instances of this class to be move constructed */ |
| 159 | NumPyAccessor(NumPyAccessor &&) = default; |
| 160 | /** Prevent instances of this class from being copied (As this class contains pointers) */ |
| 161 | NumPyAccessor(const NumPyAccessor &) = delete; |
| 162 | /** Prevent instances of this class from being copied (As this class contains pointers) */ |
| 163 | NumPyAccessor &operator=(const NumPyAccessor &) = delete; |
| 164 | |
| 165 | // Inherited methods overriden: |
| 166 | bool access_tensor(ITensor &tensor) override; |
| 167 | |
| 168 | private: |
| 169 | template <typename T> |
Isabella Gottardi | 0ae5de9 | 2019-03-14 10:32:11 +0000 | [diff] [blame] | 170 | void access_numpy_tensor(ITensor &tensor, T tolerance); |
Isabella Gottardi | 88d5b22 | 2018-04-06 12:24:55 +0100 | [diff] [blame] | 171 | |
| 172 | Tensor _npy_tensor; |
| 173 | const std::string _filename; |
| 174 | std::ostream &_output_stream; |
| 175 | }; |
| 176 | |
Isabella Gottardi | 2ea3761 | 2019-07-16 11:48:51 +0100 | [diff] [blame] | 177 | /** SaveNumPy accessor class */ |
| 178 | class SaveNumPyAccessor final : public graph::ITensorAccessor |
| 179 | { |
| 180 | public: |
| 181 | /** Constructor |
| 182 | * |
| 183 | * @param[in] npy_name Npy file name. |
| 184 | * @param[in] is_fortran (Optional) If true, save tensor in fortran order. |
| 185 | */ |
| 186 | SaveNumPyAccessor(const std::string npy_name, const bool is_fortran = false); |
| 187 | /** Allow instances of this class to be move constructed */ |
| 188 | SaveNumPyAccessor(SaveNumPyAccessor &&) = default; |
| 189 | /** Prevent instances of this class from being copied (As this class contains pointers) */ |
| 190 | SaveNumPyAccessor(const SaveNumPyAccessor &) = delete; |
| 191 | /** Prevent instances of this class from being copied (As this class contains pointers) */ |
| 192 | SaveNumPyAccessor &operator=(const SaveNumPyAccessor &) = delete; |
| 193 | |
| 194 | // Inherited methods overriden: |
| 195 | bool access_tensor(ITensor &tensor) override; |
| 196 | |
| 197 | private: |
| 198 | const std::string _npy_name; |
| 199 | const bool _is_fortran; |
| 200 | }; |
| 201 | |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 202 | /** Image accessor class */ |
| 203 | class ImageAccessor final : public graph::ITensorAccessor |
Gian Marco | 44ec2e7 | 2017-10-19 14:13:38 +0100 | [diff] [blame] | 204 | { |
| 205 | public: |
| 206 | /** Constructor |
| 207 | * |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 208 | * @param[in] filename Image file |
Georgios Pinitas | 7c3b924 | 2018-06-21 19:01:25 +0100 | [diff] [blame] | 209 | * @param[in] bgr (Optional) Fill the first plane with blue channel (default = false - RGB format) |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 210 | * @param[in] preprocessor (Optional) Image pre-processing object |
Gian Marco | 44ec2e7 | 2017-10-19 14:13:38 +0100 | [diff] [blame] | 211 | */ |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 212 | ImageAccessor(std::string filename, bool bgr = true, std::unique_ptr<IPreprocessor> preprocessor = nullptr); |
Gian Marco | 44ec2e7 | 2017-10-19 14:13:38 +0100 | [diff] [blame] | 213 | /** Allow instances of this class to be move constructed */ |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 214 | ImageAccessor(ImageAccessor &&) = default; |
Gian Marco | 44ec2e7 | 2017-10-19 14:13:38 +0100 | [diff] [blame] | 215 | |
| 216 | // Inherited methods overriden: |
| 217 | bool access_tensor(ITensor &tensor) override; |
| 218 | |
| 219 | private: |
Anthony Barbier | 8a04211 | 2018-08-21 18:16:53 +0100 | [diff] [blame] | 220 | bool _already_loaded; |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 221 | const std::string _filename; |
Georgios Pinitas | 140fdc7 | 2018-02-16 11:42:38 +0000 | [diff] [blame] | 222 | const bool _bgr; |
| 223 | std::unique_ptr<IPreprocessor> _preprocessor; |
Gian Marco | 44ec2e7 | 2017-10-19 14:13:38 +0100 | [diff] [blame] | 224 | }; |
| 225 | |
Georgios Pinitas | 7c3b924 | 2018-06-21 19:01:25 +0100 | [diff] [blame] | 226 | /** Input Accessor used for network validation */ |
| 227 | class ValidationInputAccessor final : public graph::ITensorAccessor |
| 228 | { |
| 229 | public: |
| 230 | /** Constructor |
| 231 | * |
Anthony Barbier | 40606df | 2018-07-23 14:41:59 +0100 | [diff] [blame] | 232 | * @param[in] image_list File containing all the images to validate |
| 233 | * @param[in] images_path Path to images. |
| 234 | * @param[in] bgr (Optional) Fill the first plane with blue channel (default = false - RGB format) |
| 235 | * @param[in] preprocessor (Optional) Image pre-processing object (default = nullptr) |
| 236 | * @param[in] start (Optional) Start range |
| 237 | * @param[in] end (Optional) End range |
| 238 | * @param[out] output_stream (Optional) Output stream |
Georgios Pinitas | 7c3b924 | 2018-06-21 19:01:25 +0100 | [diff] [blame] | 239 | * |
Georgios Pinitas | 7908de7 | 2018-06-27 12:34:20 +0100 | [diff] [blame] | 240 | * @note Range is defined as [start, end] |
Georgios Pinitas | 7c3b924 | 2018-06-21 19:01:25 +0100 | [diff] [blame] | 241 | */ |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 242 | ValidationInputAccessor(const std::string &image_list, |
| 243 | std::string images_path, |
Anthony Barbier | 40606df | 2018-07-23 14:41:59 +0100 | [diff] [blame] | 244 | std::unique_ptr<IPreprocessor> preprocessor = nullptr, |
| 245 | bool bgr = true, |
| 246 | unsigned int start = 0, |
| 247 | unsigned int end = 0, |
| 248 | std::ostream &output_stream = std::cout); |
Georgios Pinitas | 7c3b924 | 2018-06-21 19:01:25 +0100 | [diff] [blame] | 249 | |
| 250 | // Inherited methods overriden: |
| 251 | bool access_tensor(ITensor &tensor) override; |
| 252 | |
| 253 | private: |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 254 | std::string _path; |
| 255 | std::vector<std::string> _images; |
| 256 | std::unique_ptr<IPreprocessor> _preprocessor; |
| 257 | bool _bgr; |
| 258 | size_t _offset; |
Anthony Barbier | 40606df | 2018-07-23 14:41:59 +0100 | [diff] [blame] | 259 | std::ostream &_output_stream; |
Georgios Pinitas | 7c3b924 | 2018-06-21 19:01:25 +0100 | [diff] [blame] | 260 | }; |
| 261 | |
Georgios Pinitas | 7908de7 | 2018-06-27 12:34:20 +0100 | [diff] [blame] | 262 | /** Output Accessor used for network validation */ |
| 263 | class ValidationOutputAccessor final : public graph::ITensorAccessor |
| 264 | { |
| 265 | public: |
| 266 | /** Default Constructor |
| 267 | * |
| 268 | * @param[in] image_list File containing all the images and labels results |
Georgios Pinitas | 7908de7 | 2018-06-27 12:34:20 +0100 | [diff] [blame] | 269 | * @param[out] output_stream (Optional) Output stream (Defaults to the standard output stream) |
| 270 | * @param[in] start (Optional) Start range |
| 271 | * @param[in] end (Optional) End range |
| 272 | * |
| 273 | * @note Range is defined as [start, end] |
| 274 | */ |
| 275 | ValidationOutputAccessor(const std::string &image_list, |
Georgios Pinitas | 7908de7 | 2018-06-27 12:34:20 +0100 | [diff] [blame] | 276 | std::ostream &output_stream = std::cout, |
| 277 | unsigned int start = 0, |
| 278 | unsigned int end = 0); |
| 279 | /** Reset accessor state */ |
| 280 | void reset(); |
| 281 | |
| 282 | // Inherited methods overriden: |
| 283 | bool access_tensor(ITensor &tensor) override; |
| 284 | |
| 285 | private: |
| 286 | /** Access predictions of the tensor |
| 287 | * |
| 288 | * @tparam T Tensor elements type |
| 289 | * |
| 290 | * @param[in] tensor Tensor to read the predictions from |
| 291 | */ |
| 292 | template <typename T> |
| 293 | std::vector<size_t> access_predictions_tensor(ITensor &tensor); |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 294 | /** Aggregates the results of a sample |
| 295 | * |
| 296 | * @param[in] res Vector containing the results of a graph |
| 297 | * @param[in,out] positive_samples Positive samples to be updated |
| 298 | * @param[in] top_n Top n accuracy to measure |
| 299 | * @param[in] correct_label Correct label of the current sample |
| 300 | */ |
| 301 | void aggregate_sample(const std::vector<size_t> &res, size_t &positive_samples, size_t top_n, size_t correct_label); |
| 302 | /** Reports top N accuracy |
| 303 | * |
| 304 | * @param[in] top_n Top N accuracy that is being reported |
| 305 | * @param[in] total_samples Total number of samples |
| 306 | * @param[in] positive_samples Positive samples |
| 307 | */ |
| 308 | void report_top_n(size_t top_n, size_t total_samples, size_t positive_samples); |
Georgios Pinitas | 7908de7 | 2018-06-27 12:34:20 +0100 | [diff] [blame] | 309 | |
| 310 | private: |
| 311 | std::vector<int> _results; |
| 312 | std::ostream &_output_stream; |
Georgios Pinitas | 7908de7 | 2018-06-27 12:34:20 +0100 | [diff] [blame] | 313 | size_t _offset; |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 314 | size_t _positive_samples_top1; |
| 315 | size_t _positive_samples_top5; |
Georgios Pinitas | 7908de7 | 2018-06-27 12:34:20 +0100 | [diff] [blame] | 316 | }; |
| 317 | |
Isabella Gottardi | 7234ed8 | 2018-11-27 08:51:10 +0000 | [diff] [blame] | 318 | /** Detection output accessor class */ |
| 319 | class DetectionOutputAccessor final : public graph::ITensorAccessor |
| 320 | { |
| 321 | public: |
| 322 | /** Constructor |
| 323 | * |
| 324 | * @param[in] labels_path Path to labels text file. |
| 325 | * @param[in] imgs_tensor_shapes Network input images tensor shapes. |
| 326 | * @param[out] output_stream (Optional) Output stream |
| 327 | */ |
| 328 | DetectionOutputAccessor(const std::string &labels_path, std::vector<TensorShape> &imgs_tensor_shapes, std::ostream &output_stream = std::cout); |
| 329 | /** Allow instances of this class to be move constructed */ |
| 330 | DetectionOutputAccessor(DetectionOutputAccessor &&) = default; |
| 331 | /** Prevent instances of this class from being copied (As this class contains pointers) */ |
| 332 | DetectionOutputAccessor(const DetectionOutputAccessor &) = delete; |
| 333 | /** Prevent instances of this class from being copied (As this class contains pointers) */ |
| 334 | DetectionOutputAccessor &operator=(const DetectionOutputAccessor &) = delete; |
| 335 | |
| 336 | // Inherited methods overriden: |
| 337 | bool access_tensor(ITensor &tensor) override; |
| 338 | |
| 339 | private: |
| 340 | template <typename T> |
| 341 | void access_predictions_tensor(ITensor &tensor); |
| 342 | |
| 343 | std::vector<std::string> _labels; |
| 344 | std::vector<TensorShape> _tensor_shapes; |
| 345 | std::ostream &_output_stream; |
| 346 | }; |
| 347 | |
Gian Marco | 44ec2e7 | 2017-10-19 14:13:38 +0100 | [diff] [blame] | 348 | /** Result accessor class */ |
| 349 | class TopNPredictionsAccessor final : public graph::ITensorAccessor |
| 350 | { |
| 351 | public: |
| 352 | /** Constructor |
| 353 | * |
| 354 | * @param[in] labels_path Path to labels text file. |
| 355 | * @param[in] top_n (Optional) Number of output classes to print |
| 356 | * @param[out] output_stream (Optional) Output stream |
| 357 | */ |
| 358 | TopNPredictionsAccessor(const std::string &labels_path, size_t top_n = 5, std::ostream &output_stream = std::cout); |
| 359 | /** Allow instances of this class to be move constructed */ |
| 360 | TopNPredictionsAccessor(TopNPredictionsAccessor &&) = default; |
| 361 | /** Prevent instances of this class from being copied (As this class contains pointers) */ |
| 362 | TopNPredictionsAccessor(const TopNPredictionsAccessor &) = delete; |
| 363 | /** Prevent instances of this class from being copied (As this class contains pointers) */ |
| 364 | TopNPredictionsAccessor &operator=(const TopNPredictionsAccessor &) = delete; |
| 365 | |
| 366 | // Inherited methods overriden: |
| 367 | bool access_tensor(ITensor &tensor) override; |
| 368 | |
| 369 | private: |
Giorgio Arena | a66eaa2 | 2017-12-21 19:50:06 +0000 | [diff] [blame] | 370 | template <typename T> |
| 371 | void access_predictions_tensor(ITensor &tensor); |
| 372 | |
Gian Marco | 44ec2e7 | 2017-10-19 14:13:38 +0100 | [diff] [blame] | 373 | std::vector<std::string> _labels; |
| 374 | std::ostream &_output_stream; |
| 375 | size_t _top_n; |
| 376 | }; |
| 377 | |
Michalis Spyrou | 53b405f | 2017-09-27 15:55:31 +0100 | [diff] [blame] | 378 | /** Random accessor class */ |
| 379 | class RandomAccessor final : public graph::ITensorAccessor |
| 380 | { |
| 381 | public: |
| 382 | /** Constructor |
| 383 | * |
| 384 | * @param[in] lower Lower bound value. |
| 385 | * @param[in] upper Upper bound value. |
| 386 | * @param[in] seed (Optional) Seed used to initialise the random number generator. |
| 387 | */ |
| 388 | RandomAccessor(PixelValue lower, PixelValue upper, const std::random_device::result_type seed = 0); |
| 389 | /** Allows instances to move constructed */ |
| 390 | RandomAccessor(RandomAccessor &&) = default; |
| 391 | |
| 392 | // Inherited methods overriden: |
| 393 | bool access_tensor(ITensor &tensor) override; |
| 394 | |
| 395 | private: |
| 396 | template <typename T, typename D> |
| 397 | void fill(ITensor &tensor, D &&distribution); |
| 398 | PixelValue _lower; |
| 399 | PixelValue _upper; |
| 400 | std::random_device::result_type _seed; |
| 401 | }; |
| 402 | |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 403 | /** Numpy Binary loader class*/ |
Michalis Spyrou | 53b405f | 2017-09-27 15:55:31 +0100 | [diff] [blame] | 404 | class NumPyBinLoader final : public graph::ITensorAccessor |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 405 | { |
| 406 | public: |
| 407 | /** Default Constructor |
| 408 | * |
Georgios Pinitas | cac13b1 | 2018-04-27 19:07:19 +0100 | [diff] [blame] | 409 | * @param[in] filename Binary file name |
| 410 | * @param[in] file_layout (Optional) Layout of the numpy tensor data. Defaults to NCHW |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 411 | */ |
Georgios Pinitas | cac13b1 | 2018-04-27 19:07:19 +0100 | [diff] [blame] | 412 | NumPyBinLoader(std::string filename, DataLayout file_layout = DataLayout::NCHW); |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 413 | /** Allows instances to move constructed */ |
| 414 | NumPyBinLoader(NumPyBinLoader &&) = default; |
| 415 | |
| 416 | // Inherited methods overriden: |
| 417 | bool access_tensor(ITensor &tensor) override; |
| 418 | |
| 419 | private: |
Anthony Barbier | 8a04211 | 2018-08-21 18:16:53 +0100 | [diff] [blame] | 420 | bool _already_loaded; |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 421 | const std::string _filename; |
Georgios Pinitas | cac13b1 | 2018-04-27 19:07:19 +0100 | [diff] [blame] | 422 | const DataLayout _file_layout; |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 423 | }; |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 424 | |
Georgios Pinitas | 652bde5 | 2018-01-10 15:33:28 +0000 | [diff] [blame] | 425 | /** Generates appropriate random accessor |
| 426 | * |
| 427 | * @param[in] lower Lower random values bound |
| 428 | * @param[in] upper Upper random values bound |
| 429 | * @param[in] seed Random generator seed |
| 430 | * |
| 431 | * @return A ramdom accessor |
| 432 | */ |
| 433 | inline std::unique_ptr<graph::ITensorAccessor> get_random_accessor(PixelValue lower, PixelValue upper, const std::random_device::result_type seed = 0) |
| 434 | { |
| 435 | return arm_compute::support::cpp14::make_unique<RandomAccessor>(lower, upper, seed); |
| 436 | } |
| 437 | |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 438 | /** Generates appropriate weights accessor according to the specified path |
| 439 | * |
| 440 | * @note If path is empty will generate a DummyAccessor else will generate a NumPyBinLoader |
| 441 | * |
Georgios Pinitas | cac13b1 | 2018-04-27 19:07:19 +0100 | [diff] [blame] | 442 | * @param[in] path Path to the data files |
| 443 | * @param[in] data_file Relative path to the data files from path |
| 444 | * @param[in] file_layout (Optional) Layout of file. Defaults to NCHW |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 445 | * |
| 446 | * @return An appropriate tensor accessor |
| 447 | */ |
Georgios Pinitas | cac13b1 | 2018-04-27 19:07:19 +0100 | [diff] [blame] | 448 | inline std::unique_ptr<graph::ITensorAccessor> get_weights_accessor(const std::string &path, |
| 449 | const std::string &data_file, |
| 450 | DataLayout file_layout = DataLayout::NCHW) |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 451 | { |
| 452 | if(path.empty()) |
| 453 | { |
| 454 | return arm_compute::support::cpp14::make_unique<DummyAccessor>(); |
| 455 | } |
| 456 | else |
| 457 | { |
Georgios Pinitas | cac13b1 | 2018-04-27 19:07:19 +0100 | [diff] [blame] | 458 | return arm_compute::support::cpp14::make_unique<NumPyBinLoader>(path + data_file, file_layout); |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 459 | } |
| 460 | } |
| 461 | |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 462 | /** Generates appropriate input accessor according to the specified graph parameters |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 463 | * |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 464 | * @param[in] graph_parameters Graph parameters |
| 465 | * @param[in] preprocessor (Optional) Preproccessor object |
| 466 | * @param[in] bgr (Optional) Fill the first plane with blue channel (default = true) |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 467 | * |
| 468 | * @return An appropriate tensor accessor |
| 469 | */ |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 470 | inline std::unique_ptr<graph::ITensorAccessor> get_input_accessor(const arm_compute::utils::CommonGraphParams &graph_parameters, |
| 471 | std::unique_ptr<IPreprocessor> preprocessor = nullptr, |
| 472 | bool bgr = true) |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 473 | { |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 474 | if(!graph_parameters.validation_file.empty()) |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 475 | { |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 476 | return arm_compute::support::cpp14::make_unique<ValidationInputAccessor>(graph_parameters.validation_file, |
| 477 | graph_parameters.validation_path, |
| 478 | std::move(preprocessor), |
| 479 | bgr, |
| 480 | graph_parameters.validation_range_start, |
| 481 | graph_parameters.validation_range_end); |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 482 | } |
| 483 | else |
| 484 | { |
Gian Marco Iodice | ad486e2 | 2018-08-07 17:17:06 +0100 | [diff] [blame] | 485 | const std::string &image_file = graph_parameters.image; |
| 486 | const std::string &image_file_lower = lower_string(image_file); |
| 487 | if(arm_compute::utility::endswith(image_file_lower, ".npy")) |
Isabella Gottardi | 88d5b22 | 2018-04-06 12:24:55 +0100 | [diff] [blame] | 488 | { |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 489 | return arm_compute::support::cpp14::make_unique<NumPyBinLoader>(image_file); |
| 490 | } |
Gian Marco Iodice | ad486e2 | 2018-08-07 17:17:06 +0100 | [diff] [blame] | 491 | else if(arm_compute::utility::endswith(image_file_lower, ".jpeg") |
| 492 | || arm_compute::utility::endswith(image_file_lower, ".jpg") |
| 493 | || arm_compute::utility::endswith(image_file_lower, ".ppm")) |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 494 | { |
| 495 | return arm_compute::support::cpp14::make_unique<ImageAccessor>(image_file, bgr, std::move(preprocessor)); |
Isabella Gottardi | 88d5b22 | 2018-04-06 12:24:55 +0100 | [diff] [blame] | 496 | } |
| 497 | else |
| 498 | { |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 499 | return arm_compute::support::cpp14::make_unique<DummyAccessor>(); |
Isabella Gottardi | 88d5b22 | 2018-04-06 12:24:55 +0100 | [diff] [blame] | 500 | } |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 501 | } |
| 502 | } |
| 503 | |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 504 | /** Generates appropriate output accessor according to the specified graph parameters |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 505 | * |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 506 | * @note If the output accessor is requested to validate the graph then ValidationOutputAccessor is generated |
| 507 | * else if output_accessor_file is empty will generate a DummyAccessor else will generate a TopNPredictionsAccessor |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 508 | * |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 509 | * @param[in] graph_parameters Graph parameters |
| 510 | * @param[in] top_n (Optional) Number of output classes to print (default = 5) |
| 511 | * @param[in] is_validation (Optional) Validation flag (default = false) |
| 512 | * @param[out] output_stream (Optional) Output stream (default = std::cout) |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 513 | * |
| 514 | * @return An appropriate tensor accessor |
| 515 | */ |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 516 | inline std::unique_ptr<graph::ITensorAccessor> get_output_accessor(const arm_compute::utils::CommonGraphParams &graph_parameters, |
| 517 | size_t top_n = 5, |
| 518 | bool is_validation = false, |
| 519 | std::ostream &output_stream = std::cout) |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 520 | { |
Michalis Spyrou | 6bff195 | 2019-10-02 17:22:11 +0100 | [diff] [blame] | 521 | ARM_COMPUTE_UNUSED(is_validation); |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 522 | if(!graph_parameters.validation_file.empty()) |
| 523 | { |
| 524 | return arm_compute::support::cpp14::make_unique<ValidationOutputAccessor>(graph_parameters.validation_file, |
| 525 | output_stream, |
| 526 | graph_parameters.validation_range_start, |
| 527 | graph_parameters.validation_range_end); |
| 528 | } |
| 529 | else if(graph_parameters.labels.empty()) |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 530 | { |
Anthony Barbier | e1a905a | 2017-12-22 13:53:46 +0000 | [diff] [blame] | 531 | return arm_compute::support::cpp14::make_unique<DummyAccessor>(0); |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 532 | } |
| 533 | else |
| 534 | { |
Georgios Pinitas | 12be7ab | 2018-07-03 12:06:23 +0100 | [diff] [blame] | 535 | return arm_compute::support::cpp14::make_unique<TopNPredictionsAccessor>(graph_parameters.labels, top_n, output_stream); |
Isabella Gottardi | a4c6188 | 2017-11-03 12:11:55 +0000 | [diff] [blame] | 536 | } |
| 537 | } |
Isabella Gottardi | 7234ed8 | 2018-11-27 08:51:10 +0000 | [diff] [blame] | 538 | /** Generates appropriate output accessor according to the specified graph parameters |
| 539 | * |
| 540 | * @note If the output accessor is requested to validate the graph then ValidationOutputAccessor is generated |
| 541 | * else if output_accessor_file is empty will generate a DummyAccessor else will generate a TopNPredictionsAccessor |
| 542 | * |
| 543 | * @param[in] graph_parameters Graph parameters |
| 544 | * @param[in] tensor_shapes Network input images tensor shapes. |
| 545 | * @param[in] is_validation (Optional) Validation flag (default = false) |
| 546 | * @param[out] output_stream (Optional) Output stream (default = std::cout) |
| 547 | * |
| 548 | * @return An appropriate tensor accessor |
| 549 | */ |
| 550 | inline std::unique_ptr<graph::ITensorAccessor> get_detection_output_accessor(const arm_compute::utils::CommonGraphParams &graph_parameters, |
| 551 | std::vector<TensorShape> tensor_shapes, |
| 552 | bool is_validation = false, |
| 553 | std::ostream &output_stream = std::cout) |
| 554 | { |
Michalis Spyrou | 6bff195 | 2019-10-02 17:22:11 +0100 | [diff] [blame] | 555 | ARM_COMPUTE_UNUSED(is_validation); |
Isabella Gottardi | 7234ed8 | 2018-11-27 08:51:10 +0000 | [diff] [blame] | 556 | if(!graph_parameters.validation_file.empty()) |
| 557 | { |
| 558 | return arm_compute::support::cpp14::make_unique<ValidationOutputAccessor>(graph_parameters.validation_file, |
| 559 | output_stream, |
| 560 | graph_parameters.validation_range_start, |
| 561 | graph_parameters.validation_range_end); |
| 562 | } |
| 563 | else if(graph_parameters.labels.empty()) |
| 564 | { |
| 565 | return arm_compute::support::cpp14::make_unique<DummyAccessor>(0); |
| 566 | } |
| 567 | else |
| 568 | { |
| 569 | return arm_compute::support::cpp14::make_unique<DetectionOutputAccessor>(graph_parameters.labels, tensor_shapes, output_stream); |
| 570 | } |
| 571 | } |
Isabella Gottardi | 88d5b22 | 2018-04-06 12:24:55 +0100 | [diff] [blame] | 572 | /** Generates appropriate npy output accessor according to the specified npy_path |
| 573 | * |
| 574 | * @note If npy_path is empty will generate a DummyAccessor else will generate a NpyAccessor |
| 575 | * |
| 576 | * @param[in] npy_path Path to npy file. |
| 577 | * @param[in] shape Shape of the numpy tensor data. |
| 578 | * @param[in] data_type DataType of the numpy tensor data. |
Isabella Gottardi | a7acb3c | 2019-01-08 13:48:44 +0000 | [diff] [blame] | 579 | * @param[in] data_layout DataLayout of the numpy tensor data. |
Isabella Gottardi | 88d5b22 | 2018-04-06 12:24:55 +0100 | [diff] [blame] | 580 | * @param[out] output_stream (Optional) Output stream |
| 581 | * |
| 582 | * @return An appropriate tensor accessor |
| 583 | */ |
Isabella Gottardi | a7acb3c | 2019-01-08 13:48:44 +0000 | [diff] [blame] | 584 | inline std::unique_ptr<graph::ITensorAccessor> get_npy_output_accessor(const std::string &npy_path, TensorShape shape, DataType data_type, DataLayout data_layout = DataLayout::NCHW, |
| 585 | std::ostream &output_stream = std::cout) |
Isabella Gottardi | 88d5b22 | 2018-04-06 12:24:55 +0100 | [diff] [blame] | 586 | { |
| 587 | if(npy_path.empty()) |
| 588 | { |
| 589 | return arm_compute::support::cpp14::make_unique<DummyAccessor>(0); |
| 590 | } |
| 591 | else |
| 592 | { |
Isabella Gottardi | a7acb3c | 2019-01-08 13:48:44 +0000 | [diff] [blame] | 593 | return arm_compute::support::cpp14::make_unique<NumPyAccessor>(npy_path, shape, data_type, data_layout, output_stream); |
Isabella Gottardi | 88d5b22 | 2018-04-06 12:24:55 +0100 | [diff] [blame] | 594 | } |
| 595 | } |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 596 | |
Isabella Gottardi | 2ea3761 | 2019-07-16 11:48:51 +0100 | [diff] [blame] | 597 | /** Generates appropriate npy output accessor according to the specified npy_path |
| 598 | * |
| 599 | * @note If npy_path is empty will generate a DummyAccessor else will generate a SaveNpyAccessor |
| 600 | * |
| 601 | * @param[in] npy_name Npy filename. |
| 602 | * @param[in] is_fortran (Optional) If true, save tensor in fortran order. |
| 603 | * |
| 604 | * @return An appropriate tensor accessor |
| 605 | */ |
| 606 | inline std::unique_ptr<graph::ITensorAccessor> get_save_npy_output_accessor(const std::string &npy_name, const bool is_fortran = false) |
| 607 | { |
| 608 | if(npy_name.empty()) |
| 609 | { |
| 610 | return arm_compute::support::cpp14::make_unique<DummyAccessor>(0); |
| 611 | } |
| 612 | else |
| 613 | { |
| 614 | return arm_compute::support::cpp14::make_unique<SaveNumPyAccessor>(npy_name, is_fortran); |
| 615 | } |
| 616 | } |
| 617 | |
Georgios Pinitas | 7d66a8e | 2018-07-17 12:28:42 +0100 | [diff] [blame] | 618 | /** Permutes a given tensor shape given the input and output data layout |
| 619 | * |
| 620 | * @param[in] tensor_shape Tensor shape to permute |
| 621 | * @param[in] in_data_layout Input tensor shape data layout |
| 622 | * @param[in] out_data_layout Output tensor shape data layout |
| 623 | * |
| 624 | * @return Permuted tensor shape |
| 625 | */ |
| 626 | inline TensorShape permute_shape(TensorShape tensor_shape, DataLayout in_data_layout, DataLayout out_data_layout) |
| 627 | { |
| 628 | if(in_data_layout != out_data_layout) |
| 629 | { |
| 630 | arm_compute::PermutationVector perm_vec = (in_data_layout == DataLayout::NCHW) ? arm_compute::PermutationVector(2U, 0U, 1U) : arm_compute::PermutationVector(1U, 2U, 0U); |
| 631 | arm_compute::permute(tensor_shape, perm_vec); |
| 632 | } |
| 633 | return tensor_shape; |
| 634 | } |
| 635 | |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 636 | /** Utility function to return the TargetHint |
| 637 | * |
| 638 | * @param[in] target Integer value which expresses the selected target. Must be 0 for NEON or 1 for OpenCL or 2 (OpenCL with Tuner) |
| 639 | * |
| 640 | * @return the TargetHint |
| 641 | */ |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 642 | inline graph::Target set_target_hint(int target) |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 643 | { |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 644 | ARM_COMPUTE_ERROR_ON_MSG(target > 3, "Invalid target. Target must be 0 (NEON), 1 (OpenCL), 2 (OpenCL + Tuner), 3 (GLES)"); |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 645 | if((target == 1 || target == 2)) |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 646 | { |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 647 | return graph::Target::CL; |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 648 | } |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 649 | else if(target == 3) |
| 650 | { |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 651 | return graph::Target::GC; |
Georgios Pinitas | fbb8054 | 2018-03-27 17:15:49 +0100 | [diff] [blame] | 652 | } |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 653 | else |
| 654 | { |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 655 | return graph::Target::NEON; |
Georgios Pinitas | d8734b5 | 2017-12-22 15:27:52 +0000 | [diff] [blame] | 656 | } |
| 657 | } |
Michalis Spyrou | e472082 | 2017-10-02 17:44:52 +0100 | [diff] [blame] | 658 | } // namespace graph_utils |
Anthony Barbier | 2a07e18 | 2017-08-04 18:20:27 +0100 | [diff] [blame] | 659 | } // namespace arm_compute |
| 660 | |
Georgios Pinitas | f52cd78 | 2019-03-25 14:06:14 +0000 | [diff] [blame] | 661 | #endif /* __ARM_COMPUTE_UTILS_GRAPH_UTILS_H__ */ |