blob: 664a39d1507707a86f2a546d4078b1d9ba26e18d [file] [log] [blame]
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001/*
Gian Marco Iodiceab2bc732022-01-19 10:06:45 +00002 * Copyright (c) 2017-2022 Arm Limited.
Anthony Barbier6ff3b192017-09-04 18:44:23 +01003 *
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 */
Anthony Barbier4dbc0a92018-08-27 13:39:47 +010024#ifndef __ARM_COMPUTE_TYPE_PRINTER_H__
25#define __ARM_COMPUTE_TYPE_PRINTER_H__
Anthony Barbier6ff3b192017-09-04 18:44:23 +010026
ramelg01cbbb0382021-09-17 17:36:57 +010027#ifdef ARM_COMPUTE_OPENCL_ENABLED
28#include "arm_compute/core/CL/ICLTensor.h"
29#endif /* ARM_COMPUTE_OPENCL_ENABLED */
30
Anthony Barbier6ff3b192017-09-04 18:44:23 +010031#include "arm_compute/core/Dimensions.h"
32#include "arm_compute/core/Error.h"
Michele Di Giorgiob8fc60f2018-04-25 11:58:07 +010033#include "arm_compute/core/GPUTarget.h"
morgolockaba2f912020-05-05 16:28:19 +010034#include "arm_compute/core/KernelDescriptors.h"
John Richardson25f23682017-11-27 14:35:09 +000035#include "arm_compute/core/Size2D.h"
John Richardsona36eae12017-09-26 16:55:59 +010036#include "arm_compute/core/Strides.h"
Georgios Pinitas3faea252017-10-30 14:13:50 +000037#include "arm_compute/core/TensorInfo.h"
Anthony Barbier6ff3b192017-09-04 18:44:23 +010038#include "arm_compute/core/Types.h"
SiCongLi1af54162021-10-06 15:25:57 +010039#include "arm_compute/core/experimental/IPostOp.h"
SiCongLi31778612021-11-12 17:33:45 +000040#include "arm_compute/core/experimental/PostOps.h"
Vidhya Sudhan Loganathan050471e2019-04-25 09:27:24 +010041#include "arm_compute/runtime/CL/CLTunerTypes.h"
SiCong Lidb4a6c12021-02-05 09:30:57 +000042#include "arm_compute/runtime/CL/CLTypes.h"
ramelg013ae3d882021-09-12 23:07:47 +010043#include "arm_compute/runtime/FunctionDescriptors.h"
ramelg01cbbb0382021-09-17 17:36:57 +010044#include "arm_compute/runtime/common/LSTMParams.h"
SiCongLi31778612021-11-12 17:33:45 +000045#include "support/Cast.h"
Matthew Bentham758b5ba2020-03-05 23:37:48 +000046#include "support/StringSupport.h"
Anthony Barbier6ff3b192017-09-04 18:44:23 +010047#include <ostream>
Moritz Pflanzeree493ae2017-07-05 10:52:21 +010048#include <sstream>
49#include <string>
Anthony Barbier6ff3b192017-09-04 18:44:23 +010050
51namespace arm_compute
52{
Anthony Barbierb940fd62018-06-04 14:14:32 +010053/** Formatted output if arg is not null
54 *
55 * @param[in] arg Object to print
56 *
57 * @return String representing arg.
58 */
59template <typename T>
60std::string to_string_if_not_null(T *arg)
61{
62 if(arg == nullptr)
63 {
64 return "nullptr";
65 }
66 else
67 {
68 return to_string(*arg);
69 }
70}
Anthony Barbierb4670212018-05-18 16:55:39 +010071
ramelg014a6d9e82021-10-02 14:34:36 +010072/** Fallback method: try to use std::to_string:
73 *
74 * @param[in] val Value to convert to string
75 *
76 * @return String representing val.
77 */
78template <typename T>
79inline std::string to_string(const T &val)
80{
81 return support::cpp11::to_string(val);
82}
83
ramelg01b1ba1e32021-09-25 11:53:26 +010084/** Formatted output of a vector of objects.
85 *
ramelg014a6d9e82021-10-02 14:34:36 +010086 * @note: Using the overloaded to_string() instead of overloaded operator<<(), because to_string() functions are
87 * overloaded for all types, where two or more of them can use the same operator<<(), ITensor is an example.
88 *
ramelg01b1ba1e32021-09-25 11:53:26 +010089 * @param[out] os Output stream
90 * @param[in] args Vector of objects to print
91 *
92 * @return Modified output stream.
93 */
94template <typename T>
ramelg014a6d9e82021-10-02 14:34:36 +010095::std::ostream &operator<<(::std::ostream &os, const std::vector<T> &args)
ramelg01b1ba1e32021-09-25 11:53:26 +010096{
97 const size_t max_print_size = 5U;
98
99 os << "[";
100 bool first = true;
101 size_t i;
102 for(i = 0; i < args.size(); ++i)
103 {
104 if(i == max_print_size)
105 {
106 break;
107 }
108 if(first)
109 {
110 first = false;
111 }
112 else
113 {
114 os << ", ";
115 }
ramelg014a6d9e82021-10-02 14:34:36 +0100116 os << to_string(args[i]);
ramelg01b1ba1e32021-09-25 11:53:26 +0100117 }
118 if(i < args.size())
119 {
120 os << ", ...";
121 }
122 os << "]";
123 return os;
124}
125
ramelg014a6d9e82021-10-02 14:34:36 +0100126/** Formatted output of a vector of objects.
127 *
128 * @param[in] args Vector of objects to print
129 *
130 * @return String representing args.
131 */
132template <typename T>
133std::string to_string(const std::vector<T> &args)
134{
135 std::stringstream str;
136 str << args;
137 return str.str();
138}
139
SiCongLi1af54162021-10-06 15:25:57 +0100140/** @name (EXPERIMENTAL_POST_OPS)
141 * @{
142 */
143/** Formmated output of the @ref experimental::PostOpType type
144 *
145 * @param[out] os Output stream.
146 * @param[in] post_op_type Type to output.
147 *
148 * @return Modified output stream.
149 */
150inline ::std::ostream &operator<<(::std::ostream &os, experimental::PostOpType post_op_type)
151{
152 os << "type=";
153 switch(post_op_type)
154 {
155 case experimental::PostOpType::Activation:
156 {
157 os << "Activation";
158 break;
159 }
160 case experimental::PostOpType::Eltwise_Add:
161 {
162 os << "Eltwise_Add";
163 break;
164 }
ramelg016049eda2021-10-29 10:52:53 +0100165 case experimental::PostOpType::Eltwise_PRelu:
166 {
167 os << "Eltwise_PRelu";
168 break;
169 }
SiCongLi1af54162021-10-06 15:25:57 +0100170 default:
171 {
172 ARM_COMPUTE_ERROR("Unsupported PostOpType");
173 break;
174 }
175 }
176 return os;
177}
178/** Converts a @ref experimental::PostOpType to string
179 *
180 * @param[in] post_op_type PostOpType value to be converted
181 *
182 * @return String representing the corresponding PostOpType
183 */
184inline std::string to_string(experimental::PostOpType post_op_type)
185{
186 std::stringstream str;
187 str << post_op_type;
188 return str.str();
189}
190/** Formatted output of the @ref experimental::IPostOp type.
191 *
192 * @param[out] os Output stream.
193 * @param[in] post_op Type to output.
194 *
195 * @return Modified output stream.
196 */
197template <typename T>
198inline ::std::ostream &operator<<(::std::ostream &os, const experimental::IPostOp<T> &post_op)
199{
200 os << "<";
201 os << post_op.type() << ",";
SiCongLieb8bd812021-10-29 15:05:49 +0100202 os << "prev_dst_pos=" << post_op.prev_dst_pos() << ",";
SiCongLi1af54162021-10-06 15:25:57 +0100203 switch(post_op.type())
204 {
205 case experimental::PostOpType::Activation:
206 {
207 const auto _post_op = utils::cast::polymorphic_downcast<const experimental::PostOpAct<T> *>(&post_op);
208 os << "act_info=" << &(_post_op->_act_info);
209 break;
210 }
211 case experimental::PostOpType::Eltwise_Add:
212 {
213 const auto _post_op = utils::cast::polymorphic_downcast<const experimental::PostOpEltwiseAdd<T> *>(&post_op);
214 os << "convert_policy=" << _post_op->_policy;
215 break;
216 }
ramelg016049eda2021-10-29 10:52:53 +0100217 case experimental::PostOpType::Eltwise_PRelu:
218 {
219 const auto _post_op = utils::cast::polymorphic_downcast<const experimental::PostOpEltwisePRelu<T> *>(&post_op);
220 os << "convert_policy=" << _post_op->_policy;
221 break;
222 }
SiCongLi1af54162021-10-06 15:25:57 +0100223 default:
224 {
225 ARM_COMPUTE_ERROR("Unsupported PostOpType");
226 break;
227 }
228 }
229 os << ">";
230 return os;
231}
232/** Converts an @ref experimental::IPostOp to string
233 *
234 * @param[in] post_op IPostOp value to be converted
235 *
236 * @return String representing the corresponding IPostOp
237 */
238template <typename T>
239inline std::string to_string(const experimental::IPostOp<T> &post_op)
240{
241 std::stringstream str;
242 str << post_op;
243 return str.str();
244}
245/** Formatted output of the @ref experimental::PostOpList type.
246 *
247 * @param[out] os Output stream.
248 * @param[in] post_ops Type to output.
249 *
250 * @return Modified output stream.
251 */
252template <typename T>
253inline ::std::ostream &operator<<(::std::ostream &os, const experimental::PostOpList<T> &post_ops)
254{
255 os << "[";
256 for(const auto &post_op : post_ops.get_list())
257 {
258 os << *post_op << ",";
259 }
260 os << "]";
261 return os;
262}
263/** Converts a @ref experimental::PostOpList to string
264 *
265 * @param[in] post_ops PostOpList value to be converted
266 *
267 * @return String representing the corresponding PostOpList
268 */
269template <typename T>
270inline std::string to_string(const experimental::PostOpList<T> &post_ops)
271{
272 std::stringstream str;
273 str << post_ops;
274 return str.str();
275}
276/** @} */ // end of group (EXPERIMENTAL_POST_OPS)
277
Alex Gildayc357c472018-03-21 13:54:09 +0000278/** Formatted output of the Dimensions type.
279 *
280 * @param[out] os Output stream.
281 * @param[in] dimensions Type to output.
282 *
283 * @return Modified output stream.
284 */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100285template <typename T>
286inline ::std::ostream &operator<<(::std::ostream &os, const Dimensions<T> &dimensions)
287{
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100288 if(dimensions.num_dimensions() > 0)
289 {
290 os << dimensions[0];
291
292 for(unsigned int d = 1; d < dimensions.num_dimensions(); ++d)
293 {
Freddie Liardetdd23f2a2021-06-17 13:30:11 +0100294 os << "," << dimensions[d];
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100295 }
296 }
297
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100298 return os;
299}
300
Alex Gildayc357c472018-03-21 13:54:09 +0000301/** Formatted output of the RoundingPolicy type.
302 *
303 * @param[out] os Output stream.
304 * @param[in] rounding_policy Type to output.
305 *
306 * @return Modified output stream.
307 */
Anthony Barbier2a07e182017-08-04 18:20:27 +0100308inline ::std::ostream &operator<<(::std::ostream &os, const RoundingPolicy &rounding_policy)
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100309{
Anthony Barbier2a07e182017-08-04 18:20:27 +0100310 switch(rounding_policy)
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100311 {
Anthony Barbier2a07e182017-08-04 18:20:27 +0100312 case RoundingPolicy::TO_ZERO:
313 os << "TO_ZERO";
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100314 break;
Anthony Barbier2a07e182017-08-04 18:20:27 +0100315 case RoundingPolicy::TO_NEAREST_UP:
316 os << "TO_NEAREST_UP";
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100317 break;
Anthony Barbier2a07e182017-08-04 18:20:27 +0100318 case RoundingPolicy::TO_NEAREST_EVEN:
319 os << "TO_NEAREST_EVEN";
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100320 break;
321 default:
322 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
323 }
324
325 return os;
326}
327
Alex Gildayc357c472018-03-21 13:54:09 +0000328/** Formatted output of the WeightsInfo type.
329 *
330 * @param[out] os Output stream.
331 * @param[in] weights_info Type to output.
332 *
333 * @return Modified output stream.
334 */
Anthony Barbier2a07e182017-08-04 18:20:27 +0100335inline ::std::ostream &operator<<(::std::ostream &os, const WeightsInfo &weights_info)
Isabella Gottardi1fab09f2017-07-13 15:55:57 +0100336{
Anthony Barbier2a07e182017-08-04 18:20:27 +0100337 os << weights_info.are_reshaped() << ";";
338 os << weights_info.num_kernels() << ";" << weights_info.kernel_size().first << "," << weights_info.kernel_size().second;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100339
340 return os;
341}
342
Alex Gildayc357c472018-03-21 13:54:09 +0000343/** Formatted output of the ROIPoolingInfo type.
344 *
345 * @param[out] os Output stream.
346 * @param[in] pool_info Type to output.
347 *
348 * @return Modified output stream.
349 */
Anthony Barbier2a07e182017-08-04 18:20:27 +0100350inline ::std::ostream &operator<<(::std::ostream &os, const ROIPoolingLayerInfo &pool_info)
Sanghoon Lee70f82912017-08-24 14:21:24 +0100351{
Anthony Barbier2a07e182017-08-04 18:20:27 +0100352 os << pool_info.pooled_width() << "x" << pool_info.pooled_height() << "~" << pool_info.spatial_scale();
Georgios Pinitasd9769582017-08-03 10:19:40 +0100353 return os;
354}
355
giuros0118870812018-09-13 09:31:40 +0100356/** Formatted output of the ROIPoolingInfo type.
357 *
358 * @param[in] pool_info Type to output.
359 *
360 * @return Formatted string.
361 */
362inline std::string to_string(const ROIPoolingLayerInfo &pool_info)
363{
364 std::stringstream str;
365 str << pool_info;
366 return str.str();
367}
368
morgolockaba2f912020-05-05 16:28:19 +0100369/** Formatted output of the GEMMKernelInfo type.
370 *
371 * @param[out] os Output stream.
372 * @param[in] gemm_info Type to output.
373 *
374 * @return Modified output stream.
375 */
376inline ::std::ostream &operator<<(::std::ostream &os, const GEMMKernelInfo &gemm_info)
377{
SiCongLi579ca842021-10-18 09:38:33 +0100378 os << "( m=" << gemm_info.m;
379 os << " n=" << gemm_info.n;
380 os << " k=" << gemm_info.k;
381 os << " depth_output_gemm3d=" << gemm_info.depth_output_gemm3d;
382 os << " reinterpret_input_as_3d=" << gemm_info.reinterpret_input_as_3d;
383 os << " broadcast_bias=" << gemm_info.broadcast_bias;
384 os << " fp_mixed_precision=" << gemm_info.fp_mixed_precision;
385 os << " mult_transpose1xW_width=" << gemm_info.mult_transpose1xW_width;
386 os << " mult_interleave4x4_height=" << gemm_info.mult_interleave4x4_height;
387 os << " a_offset=" << gemm_info.a_offset;
388 os << " b_offset=" << gemm_info.b_offset;
389 os << "post_ops=" << gemm_info.post_ops;
morgolockaba2f912020-05-05 16:28:19 +0100390 os << ")";
391 return os;
392}
393
394/** Formatted output of the GEMMLHSMatrixInfo type.
395 *
396 * @param[out] os Output stream.
397 * @param[in] gemm_info Type to output.
398 *
399 * @return Modified output stream.
400 */
401inline ::std::ostream &operator<<(::std::ostream &os, const GEMMLHSMatrixInfo &gemm_info)
402{
SiCongLi579ca842021-10-18 09:38:33 +0100403 os << "( m0=" << (unsigned int)gemm_info.m0 << " k0=" << gemm_info.k0 << " v0=" << gemm_info.v0 << " trans=" << gemm_info.transpose << " inter=" << gemm_info.interleave << "})";
morgolockaba2f912020-05-05 16:28:19 +0100404 return os;
405}
406
407/** Formatted output of the GEMMRHSMatrixInfo type.
408 *
409 * @param[out] os Output stream.
410 * @param[in] gemm_info Type to output.
411 *
412 * @return Modified output stream.
413 */
414inline ::std::ostream &operator<<(::std::ostream &os, const GEMMRHSMatrixInfo &gemm_info)
415{
SiCongLi579ca842021-10-18 09:38:33 +0100416 os << "( n0=" << (unsigned int)gemm_info.n0 << " k0=" << gemm_info.k0 << " h0=" << gemm_info.h0 << " trans=" << gemm_info.transpose << " inter=" << gemm_info.interleave << " exp_img=" <<
SiCong Lidb4a6c12021-02-05 09:30:57 +0000417 gemm_info.export_to_cl_image << "})";
morgolockaba2f912020-05-05 16:28:19 +0100418 return os;
419}
420
421/** Formatted output of the GEMMRHSMatrixInfo type.
422 *
423 * @param[in] gemm_info GEMMRHSMatrixInfo to output.
424 *
425 * @return Formatted string.
426 */
427inline std::string to_string(const GEMMRHSMatrixInfo &gemm_info)
428{
429 std::stringstream str;
430 str << gemm_info;
431 return str.str();
432}
433
434/** Formatted output of the GEMMLHSMatrixInfo type.
435 *
436 * @param[in] gemm_info GEMMLHSMatrixInfo to output.
437 *
438 * @return Formatted string.
439 */
440inline std::string to_string(const GEMMLHSMatrixInfo &gemm_info)
441{
442 std::stringstream str;
443 str << gemm_info;
444 return str.str();
445}
446
447/** Formatted output of the GEMMKernelInfo type.
448 *
449 * @param[in] gemm_info GEMMKernelInfo Type to output.
450 *
451 * @return Formatted string.
452 */
453inline std::string to_string(const GEMMKernelInfo &gemm_info)
454{
455 std::stringstream str;
456 str << gemm_info;
457 return str.str();
458}
459
giuros01c04a0e82018-10-03 12:44:35 +0100460/** Formatted output of the BoundingBoxTransformInfo type.
461 *
462 * @param[out] os Output stream.
463 * @param[in] bbox_info Type to output.
464 *
465 * @return Modified output stream.
466 */
467inline ::std::ostream &operator<<(::std::ostream &os, const BoundingBoxTransformInfo &bbox_info)
468{
469 auto weights = bbox_info.weights();
SiCongLi579ca842021-10-18 09:38:33 +0100470 os << "(" << bbox_info.img_width() << "x" << bbox_info.img_height() << ")~" << bbox_info.scale() << "(weights={" << weights[0] << ", " << weights[1] << ", " << weights[2] << ", " << weights[3] <<
giuros01c04a0e82018-10-03 12:44:35 +0100471 "})";
472 return os;
473}
474
475/** Formatted output of the BoundingBoxTransformInfo type.
476 *
477 * @param[in] bbox_info Type to output.
478 *
479 * @return Formatted string.
480 */
481inline std::string to_string(const BoundingBoxTransformInfo &bbox_info)
482{
483 std::stringstream str;
484 str << bbox_info;
485 return str.str();
486}
487
Manuel Bottini5209be52019-02-13 16:34:56 +0000488/** Formatted output of the ComputeAnchorsInfo type.
489 *
490 * @param[out] os Output stream.
491 * @param[in] anchors_info Type to output.
492 *
493 * @return Modified output stream.
494 */
495inline ::std::ostream &operator<<(::std::ostream &os, const ComputeAnchorsInfo &anchors_info)
496{
497 os << "(" << anchors_info.feat_width() << "x" << anchors_info.feat_height() << ")~" << anchors_info.spatial_scale();
498 return os;
499}
500
501/** Formatted output of the ComputeAnchorsInfo type.
502 *
503 * @param[in] anchors_info Type to output.
504 *
505 * @return Formatted string.
506 */
507inline std::string to_string(const ComputeAnchorsInfo &anchors_info)
508{
509 std::stringstream str;
510 str << anchors_info;
511 return str.str();
512}
513
514/** Formatted output of the GenerateProposalsInfo type.
515 *
516 * @param[out] os Output stream.
517 * @param[in] proposals_info Type to output.
518 *
519 * @return Modified output stream.
520 */
521inline ::std::ostream &operator<<(::std::ostream &os, const GenerateProposalsInfo &proposals_info)
522{
523 os << "(" << proposals_info.im_width() << "x" << proposals_info.im_height() << ")~" << proposals_info.im_scale();
524 return os;
525}
526
527/** Formatted output of the GenerateProposalsInfo type.
528 *
529 * @param[in] proposals_info Type to output.
530 *
531 * @return Formatted string.
532 */
533inline std::string to_string(const GenerateProposalsInfo &proposals_info)
534{
535 std::stringstream str;
536 str << proposals_info;
537 return str.str();
538}
539
Alex Gildayc357c472018-03-21 13:54:09 +0000540/** Formatted output of the QuantizationInfo type.
541 *
Georgios Pinitas4c5469b2019-05-21 13:32:43 +0100542 * @param[out] os Output stream.
543 * @param[in] qinfo Type to output.
Alex Gildayc357c472018-03-21 13:54:09 +0000544 *
545 * @return Modified output stream.
546 */
Georgios Pinitas4c5469b2019-05-21 13:32:43 +0100547inline ::std::ostream &operator<<(::std::ostream &os, const QuantizationInfo &qinfo)
Chunosovd621bca2017-11-03 17:33:15 +0700548{
Georgios Pinitas3d13af82019-06-04 13:04:16 +0100549 const UniformQuantizationInfo uqinfo = qinfo.uniform();
550 os << "Scale:" << uqinfo.scale << "~";
551 os << "Offset:" << uqinfo.offset;
Chunosovd621bca2017-11-03 17:33:15 +0700552 return os;
553}
554
Alex Gildayc357c472018-03-21 13:54:09 +0000555/** Formatted output of the QuantizationInfo type.
556 *
557 * @param[in] quantization_info Type to output.
558 *
559 * @return Formatted string.
560 */
Chunosovd621bca2017-11-03 17:33:15 +0700561inline std::string to_string(const QuantizationInfo &quantization_info)
562{
563 std::stringstream str;
564 str << quantization_info;
565 return str.str();
566}
567
Alex Gildayc357c472018-03-21 13:54:09 +0000568/** Formatted output of the activation function type.
569 *
570 * @param[out] os Output stream.
571 * @param[in] act_function Type to output.
572 *
573 * @return Modified output stream.
574 */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100575inline ::std::ostream &operator<<(::std::ostream &os, const ActivationLayerInfo::ActivationFunction &act_function)
576{
577 switch(act_function)
578 {
579 case ActivationLayerInfo::ActivationFunction::ABS:
580 os << "ABS";
581 break;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100582 case ActivationLayerInfo::ActivationFunction::LINEAR:
583 os << "LINEAR";
584 break;
585 case ActivationLayerInfo::ActivationFunction::LOGISTIC:
586 os << "LOGISTIC";
587 break;
588 case ActivationLayerInfo::ActivationFunction::RELU:
589 os << "RELU";
590 break;
Georgios Pinitas579c0492017-07-12 16:12:12 +0100591 case ActivationLayerInfo::ActivationFunction::BOUNDED_RELU:
592 os << "BOUNDED_RELU";
593 break;
594 case ActivationLayerInfo::ActivationFunction::LEAKY_RELU:
595 os << "LEAKY_RELU";
596 break;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100597 case ActivationLayerInfo::ActivationFunction::SOFT_RELU:
598 os << "SOFT_RELU";
599 break;
600 case ActivationLayerInfo::ActivationFunction::SQRT:
601 os << "SQRT";
602 break;
Anthony Barbier2a07e182017-08-04 18:20:27 +0100603 case ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU:
604 os << "LU_BOUNDED_RELU";
Kevin Petitd9f80712017-12-06 12:18:48 +0000605 break;
Georgios Pinitasfb0fdcd2019-08-22 17:10:04 +0100606 case ActivationLayerInfo::ActivationFunction::ELU:
607 os << "ELU";
608 break;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100609 case ActivationLayerInfo::ActivationFunction::SQUARE:
610 os << "SQUARE";
611 break;
612 case ActivationLayerInfo::ActivationFunction::TANH:
613 os << "TANH";
614 break;
Usama Arif6a98a6e2019-05-10 17:07:27 +0100615 case ActivationLayerInfo::ActivationFunction::IDENTITY:
616 os << "IDENTITY";
617 break;
morgolock07df3d42020-02-27 11:46:28 +0000618 case ActivationLayerInfo::ActivationFunction::HARD_SWISH:
619 os << "HARD_SWISH";
620 break;
621
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100622 default:
623 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
624 }
625
626 return os;
627}
628
Alex Gildayc357c472018-03-21 13:54:09 +0000629/** Formatted output of the activation function info type.
630 *
SiCongLi1af54162021-10-06 15:25:57 +0100631 * @param[in] info ActivationLayerInfo to output.
Alex Gildayc357c472018-03-21 13:54:09 +0000632 *
633 * @return Formatted string.
634 */
Anthony Barbier2a07e182017-08-04 18:20:27 +0100635inline std::string to_string(const arm_compute::ActivationLayerInfo &info)
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100636{
637 std::stringstream str;
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000638 if(info.enabled())
639 {
640 str << info.activation();
641 }
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100642 return str.str();
643}
644
SiCongLi1af54162021-10-06 15:25:57 +0100645/** Formatted output of the activation function info.
ramelg013ae3d882021-09-12 23:07:47 +0100646 *
SiCongLi1af54162021-10-06 15:25:57 +0100647 * @param[out] os Output stream.
648 * @param[in] info ActivationLayerInfo to output.
ramelg013ae3d882021-09-12 23:07:47 +0100649 *
650 * @return Formatted string.
651 */
SiCongLi1af54162021-10-06 15:25:57 +0100652inline ::std::ostream &operator<<(::std::ostream &os, const ActivationLayerInfo *info)
ramelg013ae3d882021-09-12 23:07:47 +0100653{
ramelg013ae3d882021-09-12 23:07:47 +0100654 if(info != nullptr)
655 {
ramelg013ae3d882021-09-12 23:07:47 +0100656 if(info->enabled())
657 {
SiCongLi1af54162021-10-06 15:25:57 +0100658 os << info->activation();
659 os << "(";
660 os << "VAL_A=" << info->a() << ",";
661 os << "VAL_B=" << info->b();
662 os << ")";
ramelg013ae3d882021-09-12 23:07:47 +0100663 }
SiCongLi1af54162021-10-06 15:25:57 +0100664 else
665 {
666 os << "disabled";
667 }
ramelg013ae3d882021-09-12 23:07:47 +0100668 }
SiCongLi1af54162021-10-06 15:25:57 +0100669 else
670 {
671 os << "nullptr";
672 }
673 return os;
ramelg013ae3d882021-09-12 23:07:47 +0100674}
675
Alex Gildayc357c472018-03-21 13:54:09 +0000676/** Formatted output of the activation function type.
677 *
678 * @param[in] function Type to output.
679 *
680 * @return Formatted string.
681 */
Anthony Barbier2a07e182017-08-04 18:20:27 +0100682inline std::string to_string(const arm_compute::ActivationLayerInfo::ActivationFunction &function)
683{
684 std::stringstream str;
685 str << function;
686 return str.str();
687}
688
Alex Gildayc357c472018-03-21 13:54:09 +0000689/** Formatted output of the NormType type.
690 *
691 * @param[out] os Output stream.
692 * @param[in] norm_type Type to output.
693 *
694 * @return Modified output stream.
695 */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100696inline ::std::ostream &operator<<(::std::ostream &os, const NormType &norm_type)
697{
698 switch(norm_type)
699 {
700 case NormType::CROSS_MAP:
701 os << "CROSS_MAP";
702 break;
703 case NormType::IN_MAP_1D:
704 os << "IN_MAP_1D";
705 break;
706 case NormType::IN_MAP_2D:
707 os << "IN_MAP_2D";
708 break;
709 default:
710 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
711 }
712
713 return os;
714}
715
Alex Gildayc357c472018-03-21 13:54:09 +0000716/** Formatted output of @ref NormalizationLayerInfo.
717 *
718 * @param[in] info Type to output.
719 *
720 * @return Formatted string.
721 */
Anthony Barbier2a07e182017-08-04 18:20:27 +0100722inline std::string to_string(const arm_compute::NormalizationLayerInfo &info)
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100723{
724 std::stringstream str;
Michalis Spyroud466c2d2018-01-30 10:54:39 +0000725 str << info.type() << ":NormSize=" << info.norm_size();
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100726 return str.str();
727}
728
Alex Gildayc357c472018-03-21 13:54:09 +0000729/** Formatted output of @ref NormalizationLayerInfo.
730 *
731 * @param[out] os Output stream.
732 * @param[in] info Type to output.
733 *
734 * @return Modified output stream.
735 */
Georgios Pinitas6f669f02017-09-26 12:32:57 +0100736inline ::std::ostream &operator<<(::std::ostream &os, const NormalizationLayerInfo &info)
737{
Michalis Spyroud466c2d2018-01-30 10:54:39 +0000738 os << info.type() << ":NormSize=" << info.norm_size();
Georgios Pinitas6f669f02017-09-26 12:32:57 +0100739 return os;
740}
741
Alex Gildayc357c472018-03-21 13:54:09 +0000742/** Formatted output of the PoolingType type.
743 *
744 * @param[out] os Output stream.
745 * @param[in] pool_type Type to output.
746 *
747 * @return Modified output stream.
748 */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100749inline ::std::ostream &operator<<(::std::ostream &os, const PoolingType &pool_type)
750{
751 switch(pool_type)
752 {
753 case PoolingType::AVG:
754 os << "AVG";
755 break;
756 case PoolingType::MAX:
757 os << "MAX";
758 break;
Georgios Pinitascdf51452017-08-31 14:21:36 +0100759 case PoolingType::L2:
760 os << "L2";
761 break;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100762 default:
763 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
764 }
765
766 return os;
767}
768
Alex Gildayc357c472018-03-21 13:54:09 +0000769/** Formatted output of @ref PoolingLayerInfo.
770 *
771 * @param[out] os Output stream.
772 * @param[in] info Type to output.
773 *
774 * @return Modified output stream.
775 */
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100776inline ::std::ostream &operator<<(::std::ostream &os, const PoolingLayerInfo &info)
777{
Sang-Hoon Park0cb3da62020-01-15 12:39:56 +0000778 os << info.pool_type;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100779
780 return os;
781}
782
Alex Gildayc357c472018-03-21 13:54:09 +0000783/** Formatted output of @ref RoundingPolicy.
784 *
785 * @param[in] rounding_policy Type to output.
786 *
787 * @return Formatted string.
788 */
John Richardsondd715f22017-09-18 16:10:48 +0100789inline std::string to_string(const RoundingPolicy &rounding_policy)
790{
791 std::stringstream str;
792 str << rounding_policy;
793 return str.str();
794}
795
Vidhya Sudhan Loganathand646ae12018-11-19 15:18:20 +0000796/** [Print DataLayout type] **/
Alex Gildayc357c472018-03-21 13:54:09 +0000797/** Formatted output of the DataLayout type.
798 *
799 * @param[out] os Output stream.
800 * @param[in] data_layout Type to output.
801 *
802 * @return Modified output stream.
803 */
Michele Di Giorgio4a65b982018-03-02 11:21:38 +0000804inline ::std::ostream &operator<<(::std::ostream &os, const DataLayout &data_layout)
805{
806 switch(data_layout)
807 {
808 case DataLayout::UNKNOWN:
809 os << "UNKNOWN";
810 break;
811 case DataLayout::NHWC:
812 os << "NHWC";
813 break;
814 case DataLayout::NCHW:
815 os << "NCHW";
816 break;
Adnan AlSinane4563a02021-09-01 15:32:03 +0100817 case DataLayout::NDHWC:
818 os << "NDHWC";
819 break;
Giorgio Arenac9fe9fc2021-10-06 12:54:29 +0100820 case DataLayout::NCDHW:
821 os << "NCDHW";
822 break;
Michele Di Giorgio4a65b982018-03-02 11:21:38 +0000823 default:
824 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
825 }
826
827 return os;
828}
829
Alex Gildayc357c472018-03-21 13:54:09 +0000830/** Formatted output of the DataLayout type.
831 *
832 * @param[in] data_layout Type to output.
833 *
834 * @return Formatted string.
835 */
Michele Di Giorgio4a65b982018-03-02 11:21:38 +0000836inline std::string to_string(const arm_compute::DataLayout &data_layout)
837{
838 std::stringstream str;
839 str << data_layout;
840 return str.str();
841}
Vidhya Sudhan Loganathand646ae12018-11-19 15:18:20 +0000842/** [Print DataLayout type] **/
Michele Di Giorgio4a65b982018-03-02 11:21:38 +0000843
Georgios Pinitase2220552018-07-20 13:23:44 +0100844/** Formatted output of the DataLayoutDimension type.
845 *
846 * @param[out] os Output stream.
847 * @param[in] data_layout_dim Data layout dimension to print.
848 *
849 * @return Modified output stream.
850 */
851inline ::std::ostream &operator<<(::std::ostream &os, const DataLayoutDimension &data_layout_dim)
852{
853 switch(data_layout_dim)
854 {
855 case DataLayoutDimension::WIDTH:
856 os << "WIDTH";
857 break;
858 case DataLayoutDimension::HEIGHT:
859 os << "HEIGHT";
860 break;
861 case DataLayoutDimension::CHANNEL:
862 os << "CHANNEL";
863 break;
Giorgio Arenac9fe9fc2021-10-06 12:54:29 +0100864 case DataLayoutDimension::DEPTH:
865 os << "DEPTH";
866 break;
Georgios Pinitase2220552018-07-20 13:23:44 +0100867 case DataLayoutDimension::BATCHES:
868 os << "BATCHES";
869 break;
870 default:
871 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
872 }
873 return os;
874}
875
Alex Gildayc357c472018-03-21 13:54:09 +0000876/** Formatted output of the DataType type.
877 *
878 * @param[out] os Output stream.
879 * @param[in] data_type Type to output.
880 *
881 * @return Modified output stream.
882 */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100883inline ::std::ostream &operator<<(::std::ostream &os, const DataType &data_type)
884{
885 switch(data_type)
886 {
887 case DataType::UNKNOWN:
888 os << "UNKNOWN";
889 break;
890 case DataType::U8:
891 os << "U8";
892 break;
Georgios Pinitas4c5469b2019-05-21 13:32:43 +0100893 case DataType::QSYMM8:
894 os << "QSYMM8";
895 break;
Chunosovd621bca2017-11-03 17:33:15 +0700896 case DataType::QASYMM8:
897 os << "QASYMM8";
898 break;
Georgios Pinitas448a81f2019-11-21 14:10:25 +0000899 case DataType::QASYMM8_SIGNED:
900 os << "QASYMM8_SIGNED";
901 break;
Georgios Pinitas4c5469b2019-05-21 13:32:43 +0100902 case DataType::QSYMM8_PER_CHANNEL:
903 os << "QSYMM8_PER_CHANNEL";
904 break;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100905 case DataType::S8:
906 os << "S8";
907 break;
908 case DataType::U16:
909 os << "U16";
910 break;
911 case DataType::S16:
912 os << "S16";
913 break;
Manuel Bottini3689fcd2019-06-14 17:18:12 +0100914 case DataType::QSYMM16:
915 os << "QSYMM16";
916 break;
Michele Di Giorgio35ea9a72019-08-23 12:02:06 +0100917 case DataType::QASYMM16:
918 os << "QASYMM16";
919 break;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100920 case DataType::U32:
921 os << "U32";
922 break;
923 case DataType::S32:
924 os << "S32";
925 break;
926 case DataType::U64:
927 os << "U64";
928 break;
929 case DataType::S64:
930 os << "S64";
931 break;
Georgios Pinitase8291ac2020-02-26 09:58:13 +0000932 case DataType::BFLOAT16:
933 os << "BFLOAT16";
934 break;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100935 case DataType::F16:
936 os << "F16";
937 break;
938 case DataType::F32:
939 os << "F32";
940 break;
941 case DataType::F64:
942 os << "F64";
943 break;
944 case DataType::SIZET:
945 os << "SIZET";
946 break;
947 default:
948 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
949 }
950
951 return os;
952}
953
Alex Gildayc357c472018-03-21 13:54:09 +0000954/** Formatted output of the DataType type.
955 *
956 * @param[in] data_type Type to output.
957 *
958 * @return Formatted string.
959 */
Anthony Barbier2a07e182017-08-04 18:20:27 +0100960inline std::string to_string(const arm_compute::DataType &data_type)
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100961{
962 std::stringstream str;
963 str << data_type;
964 return str.str();
965}
966
Alex Gildayc357c472018-03-21 13:54:09 +0000967/** Formatted output of the Format type.
968 *
969 * @param[out] os Output stream.
970 * @param[in] format Type to output.
971 *
972 * @return Modified output stream.
973 */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100974inline ::std::ostream &operator<<(::std::ostream &os, const Format &format)
975{
976 switch(format)
977 {
978 case Format::UNKNOWN:
979 os << "UNKNOWN";
980 break;
981 case Format::U8:
982 os << "U8";
983 break;
984 case Format::S16:
985 os << "S16";
986 break;
987 case Format::U16:
988 os << "U16";
989 break;
990 case Format::S32:
991 os << "S32";
992 break;
993 case Format::U32:
994 os << "U32";
995 break;
996 case Format::F16:
997 os << "F16";
998 break;
999 case Format::F32:
1000 os << "F32";
1001 break;
1002 case Format::UV88:
1003 os << "UV88";
1004 break;
1005 case Format::RGB888:
1006 os << "RGB888";
1007 break;
1008 case Format::RGBA8888:
1009 os << "RGBA8888";
1010 break;
1011 case Format::YUV444:
1012 os << "YUV444";
1013 break;
1014 case Format::YUYV422:
1015 os << "YUYV422";
1016 break;
1017 case Format::NV12:
1018 os << "NV12";
1019 break;
1020 case Format::NV21:
1021 os << "NV21";
1022 break;
1023 case Format::IYUV:
1024 os << "IYUV";
1025 break;
1026 case Format::UYVY422:
1027 os << "UYVY422";
1028 break;
1029 default:
1030 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1031 }
1032
1033 return os;
1034}
1035
Alex Gildayc357c472018-03-21 13:54:09 +00001036/** Formatted output of the Format type.
1037 *
1038 * @param[in] format Type to output.
1039 *
1040 * @return Formatted string.
1041 */
Moritz Pflanzer7655a672017-09-23 11:57:33 +01001042inline std::string to_string(const Format &format)
1043{
1044 std::stringstream str;
1045 str << format;
1046 return str.str();
1047}
1048
Alex Gildayc357c472018-03-21 13:54:09 +00001049/** Formatted output of the Channel type.
1050 *
1051 * @param[out] os Output stream.
1052 * @param[in] channel Type to output.
1053 *
1054 * @return Modified output stream.
1055 */
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001056inline ::std::ostream &operator<<(::std::ostream &os, const Channel &channel)
1057{
1058 switch(channel)
1059 {
1060 case Channel::UNKNOWN:
1061 os << "UNKNOWN";
1062 break;
1063 case Channel::C0:
1064 os << "C0";
1065 break;
1066 case Channel::C1:
1067 os << "C1";
1068 break;
1069 case Channel::C2:
1070 os << "C2";
1071 break;
1072 case Channel::C3:
1073 os << "C3";
1074 break;
1075 case Channel::R:
1076 os << "R";
1077 break;
1078 case Channel::G:
1079 os << "G";
1080 break;
1081 case Channel::B:
1082 os << "B";
1083 break;
1084 case Channel::A:
1085 os << "A";
1086 break;
1087 case Channel::Y:
1088 os << "Y";
1089 break;
1090 case Channel::U:
1091 os << "U";
1092 break;
1093 case Channel::V:
1094 os << "V";
1095 break;
1096 default:
1097 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1098 }
1099
1100 return os;
1101}
1102
Alex Gildayc357c472018-03-21 13:54:09 +00001103/** Formatted output of the Channel type.
1104 *
1105 * @param[in] channel Type to output.
1106 *
1107 * @return Formatted string.
1108 */
Ioan-Cristian Szabo9414f642017-10-27 17:35:40 +01001109inline std::string to_string(const Channel &channel)
1110{
1111 std::stringstream str;
1112 str << channel;
1113 return str.str();
1114}
1115
Alex Gildayc357c472018-03-21 13:54:09 +00001116/** Formatted output of the BorderMode type.
1117 *
1118 * @param[out] os Output stream.
1119 * @param[in] mode Type to output.
1120 *
1121 * @return Modified output stream.
1122 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001123inline ::std::ostream &operator<<(::std::ostream &os, const BorderMode &mode)
1124{
1125 switch(mode)
1126 {
1127 case BorderMode::UNDEFINED:
1128 os << "UNDEFINED";
1129 break;
1130 case BorderMode::CONSTANT:
1131 os << "CONSTANT";
1132 break;
1133 case BorderMode::REPLICATE:
1134 os << "REPLICATE";
1135 break;
1136 default:
1137 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1138 }
1139
1140 return os;
1141}
1142
Alex Gildayc357c472018-03-21 13:54:09 +00001143/** Formatted output of the BorderSize type.
1144 *
1145 * @param[out] os Output stream.
1146 * @param[in] border Type to output.
1147 *
1148 * @return Modified output stream.
1149 */
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001150inline ::std::ostream &operator<<(::std::ostream &os, const BorderSize &border)
1151{
Moritz Pflanzerc87fbf82017-07-18 14:02:10 +01001152 os << border.top << ","
1153 << border.right << ","
1154 << border.bottom << ","
1155 << border.left;
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001156
1157 return os;
1158}
Anthony Barbier2a07e182017-08-04 18:20:27 +01001159
Giuseppe Rossinid7647d42018-07-17 18:13:13 +01001160/** Formatted output of the PaddingList type.
1161 *
1162 * @param[out] os Output stream.
1163 * @param[in] padding Type to output.
1164 *
1165 * @return Modified output stream.
1166 */
1167inline ::std::ostream &operator<<(::std::ostream &os, const PaddingList &padding)
1168{
1169 os << "{";
1170 for(auto const &p : padding)
1171 {
1172 os << "{" << p.first << "," << p.second << "}";
1173 }
1174 os << "}";
1175 return os;
1176}
1177
giuros013175fcf2018-11-21 09:59:17 +00001178/** Formatted output of the Multiples type.
1179 *
1180 * @param[out] os Output stream.
1181 * @param[in] multiples Type to output.
1182 *
1183 * @return Modified output stream.
1184 */
1185inline ::std::ostream &operator<<(::std::ostream &os, const Multiples &multiples)
1186{
1187 os << "(";
1188 for(size_t i = 0; i < multiples.size() - 1; i++)
1189 {
1190 os << multiples[i] << ", ";
1191 }
1192 os << multiples.back() << ")";
1193 return os;
1194}
1195
Alex Gildayc357c472018-03-21 13:54:09 +00001196/** Formatted output of the InterpolationPolicy type.
1197 *
1198 * @param[out] os Output stream.
1199 * @param[in] policy Type to output.
1200 *
1201 * @return Modified output stream.
1202 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001203inline ::std::ostream &operator<<(::std::ostream &os, const InterpolationPolicy &policy)
1204{
1205 switch(policy)
1206 {
1207 case InterpolationPolicy::NEAREST_NEIGHBOR:
1208 os << "NEAREST_NEIGHBOR";
1209 break;
1210 case InterpolationPolicy::BILINEAR:
1211 os << "BILINEAR";
1212 break;
1213 case InterpolationPolicy::AREA:
1214 os << "AREA";
1215 break;
1216 default:
1217 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1218 }
1219
1220 return os;
1221}
1222
Alex Gildayc357c472018-03-21 13:54:09 +00001223/** Formatted output of the SamplingPolicy type.
1224 *
1225 * @param[out] os Output stream.
1226 * @param[in] policy Type to output.
1227 *
1228 * @return Modified output stream.
1229 */
Daniil Efremov02bf80d2017-11-22 00:26:51 +07001230inline ::std::ostream &operator<<(::std::ostream &os, const SamplingPolicy &policy)
1231{
1232 switch(policy)
1233 {
1234 case SamplingPolicy::CENTER:
1235 os << "CENTER";
1236 break;
1237 case SamplingPolicy::TOP_LEFT:
1238 os << "TOP_LEFT";
1239 break;
1240 default:
1241 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1242 }
1243
1244 return os;
1245}
1246
Michele Di Giorgioc22eb1b2021-02-01 10:39:06 +00001247/** Formatted output of the ITensorInfo type.
1248 *
1249 * @param[out] os Output stream.
1250 * @param[in] info Tensor information.
1251 *
1252 * @return Modified output stream.
1253 */
1254inline ::std::ostream &operator<<(std::ostream &os, const ITensorInfo *info)
1255{
Georgios Pinitasc6f95102021-03-30 10:03:01 +01001256 const DataType data_type = info->data_type();
1257 const DataLayout data_layout = info->data_layout();
Michele Di Giorgioc22eb1b2021-02-01 10:39:06 +00001258
1259 os << "Shape=" << info->tensor_shape() << ","
1260 << "DataLayout=" << string_from_data_layout(data_layout) << ","
ramelg014a6d9e82021-10-02 14:34:36 +01001261 << "DataType=" << string_from_data_type(data_type);
Michele Di Giorgioc22eb1b2021-02-01 10:39:06 +00001262
1263 if(is_data_type_quantized(data_type))
1264 {
ramelg01b1ba1e32021-09-25 11:53:26 +01001265 const QuantizationInfo qinfo = info->quantization_info();
1266 const auto scales = qinfo.scale();
1267 const auto offsets = qinfo.offset();
1268
ramelg014a6d9e82021-10-02 14:34:36 +01001269 os << ", QuantizationInfo={"
ramelg01b1ba1e32021-09-25 11:53:26 +01001270 << "scales.size=" << scales.size()
1271 << ", scale(s)=" << scales << ", ";
1272
1273 os << "offsets.size=" << offsets.size()
1274 << ", offset(s)=" << offsets << "}";
Michele Di Giorgioc22eb1b2021-02-01 10:39:06 +00001275 }
1276 return os;
1277}
1278
ramelg013ae3d882021-09-12 23:07:47 +01001279/** Formatted output of the const TensorInfo& type.
Alex Gildayc357c472018-03-21 13:54:09 +00001280 *
Anthony Barbier366628a2018-08-01 13:55:03 +01001281 * @param[out] os Output stream.
1282 * @param[in] info Type to output.
1283 *
1284 * @return Modified output stream.
1285 */
1286inline ::std::ostream &operator<<(::std::ostream &os, const TensorInfo &info)
1287{
Michele Di Giorgioc22eb1b2021-02-01 10:39:06 +00001288 os << &info;
Georgios Pinitasc6f95102021-03-30 10:03:01 +01001289 return os;
Anthony Barbier366628a2018-08-01 13:55:03 +01001290}
Michele Di Giorgioc22eb1b2021-02-01 10:39:06 +00001291
ramelg013ae3d882021-09-12 23:07:47 +01001292/** Formatted output of the const TensorInfo& type.
Anthony Barbier366628a2018-08-01 13:55:03 +01001293 *
Alex Gildayc357c472018-03-21 13:54:09 +00001294 * @param[in] info Type to output.
1295 *
1296 * @return Formatted string.
1297 */
Georgios Pinitas3faea252017-10-30 14:13:50 +00001298inline std::string to_string(const TensorInfo &info)
1299{
1300 std::stringstream str;
Michele Di Giorgioc22eb1b2021-02-01 10:39:06 +00001301 str << &info;
Georgios Pinitas3faea252017-10-30 14:13:50 +00001302 return str.str();
1303}
1304
ramelg013ae3d882021-09-12 23:07:47 +01001305/** Formatted output of the const ITensorInfo& type.
1306 *
1307 * @param[in] info Type to output.
1308 *
1309 * @return Formatted string.
1310 */
1311inline std::string to_string(const ITensorInfo &info)
1312{
1313 std::stringstream str;
1314 str << &info;
1315 return str.str();
1316}
1317
ramelg013ae3d882021-09-12 23:07:47 +01001318/** Formatted output of the const ITensorInfo* type.
1319 *
1320 * @param[in] info Type to output.
1321 *
1322 * @return Formatted string.
1323 */
Ramy Elgammale920d6a2021-08-19 22:10:30 +01001324inline std::string to_string(const ITensorInfo *info)
1325{
ramelg013ae3d882021-09-12 23:07:47 +01001326 std::string ret_str = "nullptr";
1327 if(info != nullptr)
1328 {
1329 std::stringstream str;
1330 str << info;
1331 ret_str = str.str();
1332 }
1333 return ret_str;
1334}
1335
ramelg01cbbb0382021-09-17 17:36:57 +01001336/** Formatted output of the ITensorInfo* type.
1337 *
1338 * @param[in] info Type to output.
1339 *
1340 * @return Formatted string.
1341 */
1342inline std::string to_string(ITensorInfo *info)
1343{
1344 return to_string(static_cast<const ITensorInfo *>(info));
1345}
1346
1347/** Formatted output of the ITensorInfo type obtained from const ITensor* type.
ramelg013ae3d882021-09-12 23:07:47 +01001348 *
1349 * @param[in] tensor Type to output.
1350 *
1351 * @return Formatted string.
1352 */
1353inline std::string to_string(const ITensor *tensor)
1354{
1355 std::string ret_str = "nullptr";
1356 if(tensor != nullptr)
1357 {
1358 std::stringstream str;
ramelg01cbbb0382021-09-17 17:36:57 +01001359 str << "ITensor->info(): " << tensor->info();
ramelg013ae3d882021-09-12 23:07:47 +01001360 ret_str = str.str();
1361 }
1362 return ret_str;
1363}
1364
ramelg01cbbb0382021-09-17 17:36:57 +01001365/** Formatted output of the ITensorInfo type obtained from the ITensor* type.
ramelg013ae3d882021-09-12 23:07:47 +01001366 *
1367 * @param[in] tensor Type to output.
1368 *
1369 * @return Formatted string.
1370 */
1371inline std::string to_string(ITensor *tensor)
1372{
ramelg01cbbb0382021-09-17 17:36:57 +01001373 return to_string(static_cast<const ITensor *>(tensor));
ramelg013ae3d882021-09-12 23:07:47 +01001374}
1375
ramelg01cbbb0382021-09-17 17:36:57 +01001376/** Formatted output of the ITensorInfo type obtained from the ITensor& type.
ramelg013ae3d882021-09-12 23:07:47 +01001377 *
1378 * @param[in] tensor Type to output.
1379 *
1380 * @return Formatted string.
1381 */
1382inline std::string to_string(ITensor &tensor)
1383{
Ramy Elgammale920d6a2021-08-19 22:10:30 +01001384 std::stringstream str;
ramelg01cbbb0382021-09-17 17:36:57 +01001385 str << "ITensor.info(): " << tensor.info();
Ramy Elgammale920d6a2021-08-19 22:10:30 +01001386 return str.str();
1387}
1388
ramelg01cbbb0382021-09-17 17:36:57 +01001389#ifdef ARM_COMPUTE_OPENCL_ENABLED
1390/** Formatted output of the ITensorInfo type obtained from the const ICLTensor& type.
1391 *
1392 * @param[in] cl_tensor Type to output.
1393 *
1394 * @return Formatted string.
1395 */
1396inline std::string to_string(const ICLTensor *cl_tensor)
1397{
1398 std::string ret_str = "nullptr";
1399 if(cl_tensor != nullptr)
1400 {
1401 std::stringstream str;
1402 str << "ICLTensor->info(): " << cl_tensor->info();
1403 ret_str = str.str();
1404 }
1405 return ret_str;
1406}
1407
1408/** Formatted output of the ITensorInfo type obtained from the ICLTensor& type.
1409 *
1410 * @param[in] cl_tensor Type to output.
1411 *
1412 * @return Formatted string.
1413 */
1414inline std::string to_string(ICLTensor *cl_tensor)
1415{
1416 return to_string(static_cast<const ICLTensor *>(cl_tensor));
1417}
1418#endif /* ARM_COMPUTE_OPENCL_ENABLED */
1419
Alex Gildayc357c472018-03-21 13:54:09 +00001420/** Formatted output of the Dimensions type.
1421 *
1422 * @param[in] dimensions Type to output.
1423 *
1424 * @return Formatted string.
1425 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001426template <typename T>
1427inline std::string to_string(const Dimensions<T> &dimensions)
1428{
1429 std::stringstream str;
1430 str << dimensions;
1431 return str.str();
1432}
1433
Alex Gildayc357c472018-03-21 13:54:09 +00001434/** Formatted output of the Strides type.
1435 *
1436 * @param[in] stride Type to output.
1437 *
1438 * @return Formatted string.
1439 */
John Richardsona36eae12017-09-26 16:55:59 +01001440inline std::string to_string(const Strides &stride)
1441{
1442 std::stringstream str;
1443 str << stride;
1444 return str.str();
1445}
1446
Alex Gildayc357c472018-03-21 13:54:09 +00001447/** Formatted output of the TensorShape type.
1448 *
1449 * @param[in] shape Type to output.
1450 *
1451 * @return Formatted string.
1452 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001453inline std::string to_string(const TensorShape &shape)
1454{
1455 std::stringstream str;
1456 str << shape;
1457 return str.str();
1458}
1459
Alex Gildayc357c472018-03-21 13:54:09 +00001460/** Formatted output of the Coordinates type.
1461 *
1462 * @param[in] coord Type to output.
1463 *
1464 * @return Formatted string.
1465 */
Abe Mbise925ca0f2017-10-02 19:16:33 +01001466inline std::string to_string(const Coordinates &coord)
1467{
1468 std::stringstream str;
1469 str << coord;
1470 return str.str();
1471}
1472
Anthony Barbierb940fd62018-06-04 14:14:32 +01001473/** Formatted output of the GEMMReshapeInfo type.
1474 *
1475 * @param[out] os Output stream.
1476 * @param[in] info Type to output.
1477 *
1478 * @return Modified output stream.
1479 */
1480inline ::std::ostream &operator<<(::std::ostream &os, const GEMMReshapeInfo &info)
1481{
1482 os << "{m=" << info.m() << ",";
1483 os << "n=" << info.n() << ",";
1484 os << "k=" << info.k() << ",";
1485 os << "mult_transpose1xW_width=" << info.mult_transpose1xW_width() << ",";
1486 os << "mult_interleave4x4_height=" << info.mult_interleave4x4_height();
1487 os << "}";
1488
1489 return os;
1490}
1491
1492/** Formatted output of the GEMMInfo type.
1493 *
1494 * @param[out] os Output stream.
1495 * @param[in] info Type to output.
1496 *
1497 * @return Modified output stream.
1498 */
1499inline ::std::ostream &operator<<(::std::ostream &os, const GEMMInfo &info)
1500{
1501 os << "{is_a_reshaped=" << info.is_a_reshaped() << ",";
1502 os << "is_b_reshaped=" << info.is_b_reshaped() << ",";
1503 os << "reshape_b_only_on_first_run=" << info.reshape_b_only_on_first_run() << ",";
Anthony Barbierb4670212018-05-18 16:55:39 +01001504 os << "depth_output_gemm3d=" << info.depth_output_gemm3d() << ",";
1505 os << "reinterpret_input_as_3d=" << info.reinterpret_input_as_3d() << ",";
1506 os << "retain_internal_weights=" << info.retain_internal_weights() << ",";
1507 os << "fp_mixed_precision=" << info.fp_mixed_precision() << ",";
1508 os << "broadcast_bias=" << info.broadcast_bias() << ",";
ramelg01cbbb0382021-09-17 17:36:57 +01001509 os << "pretranspose_B=" << info.pretranspose_B() << ",";
SiCongLi579ca842021-10-18 09:38:33 +01001510 os << "post_ops=" << info.post_ops() << "}";
Anthony Barbierb940fd62018-06-04 14:14:32 +01001511
1512 return os;
1513}
1514
1515/** Formatted output of the Window::Dimension type.
1516 *
1517 * @param[out] os Output stream.
1518 * @param[in] dim Type to output.
1519 *
1520 * @return Modified output stream.
1521 */
1522inline ::std::ostream &operator<<(::std::ostream &os, const Window::Dimension &dim)
1523{
1524 os << "{start=" << dim.start() << ", end=" << dim.end() << ", step=" << dim.step() << "}";
1525
1526 return os;
1527}
1528/** Formatted output of the Window type.
1529 *
1530 * @param[out] os Output stream.
1531 * @param[in] win Type to output.
1532 *
1533 * @return Modified output stream.
1534 */
1535inline ::std::ostream &operator<<(::std::ostream &os, const Window &win)
1536{
1537 os << "{";
1538 for(unsigned int i = 0; i < Coordinates::num_max_dimensions; i++)
1539 {
1540 if(i > 0)
1541 {
1542 os << ", ";
1543 }
1544 os << win[i];
1545 }
1546 os << "}";
1547
1548 return os;
1549}
1550
1551/** Formatted output of the WeightsInfo type.
1552 *
1553 * @param[in] info Type to output.
1554 *
1555 * @return Formatted string.
1556 */
1557inline std::string to_string(const WeightsInfo &info)
1558{
1559 std::stringstream str;
1560 str << info;
1561 return str.str();
1562}
1563
1564/** Formatted output of the GEMMReshapeInfo type.
1565 *
1566 * @param[in] info Type to output.
1567 *
1568 * @return Formatted string.
1569 */
1570inline std::string to_string(const GEMMReshapeInfo &info)
1571{
1572 std::stringstream str;
1573 str << info;
1574 return str.str();
1575}
1576
1577/** Formatted output of the GEMMInfo type.
1578 *
1579 * @param[in] info Type to output.
1580 *
1581 * @return Formatted string.
1582 */
1583inline std::string to_string(const GEMMInfo &info)
1584{
1585 std::stringstream str;
1586 str << info;
1587 return str.str();
1588}
1589
1590/** Formatted output of the Window::Dimension type.
1591 *
1592 * @param[in] dim Type to output.
1593 *
1594 * @return Formatted string.
1595 */
1596inline std::string to_string(const Window::Dimension &dim)
1597{
1598 std::stringstream str;
1599 str << dim;
1600 return str.str();
1601}
ramelg01cbbb0382021-09-17 17:36:57 +01001602/** Formatted output of the Window& type.
Anthony Barbierb940fd62018-06-04 14:14:32 +01001603 *
1604 * @param[in] win Type to output.
1605 *
1606 * @return Formatted string.
1607 */
1608inline std::string to_string(const Window &win)
1609{
1610 std::stringstream str;
1611 str << win;
1612 return str.str();
1613}
1614
ramelg01cbbb0382021-09-17 17:36:57 +01001615/** Formatted output of the Window* type.
1616 *
1617 * @param[in] win Type to output.
1618 *
1619 * @return Formatted string.
1620 */
1621inline std::string to_string(Window *win)
1622{
1623 std::string ret_str = "nullptr";
1624 if(win != nullptr)
1625 {
1626 std::stringstream str;
1627 str << *win;
1628 ret_str = str.str();
1629 }
1630 return ret_str;
1631}
1632
Alex Gildayc357c472018-03-21 13:54:09 +00001633/** Formatted output of the Rectangle type.
1634 *
1635 * @param[out] os Output stream.
1636 * @param[in] rect Type to output.
1637 *
1638 * @return Modified output stream.
1639 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001640inline ::std::ostream &operator<<(::std::ostream &os, const Rectangle &rect)
1641{
1642 os << rect.width << "x" << rect.height;
1643 os << "+" << rect.x << "+" << rect.y;
1644
1645 return os;
1646}
1647
Usama Arif8cf8c112019-03-14 15:36:54 +00001648/** Formatted output of the PaddingMode type.
1649 *
1650 * @param[out] os Output stream.
1651 * @param[in] mode Type to output.
1652 *
1653 * @return Modified output stream.
1654 */
1655inline ::std::ostream &operator<<(::std::ostream &os, const PaddingMode &mode)
1656{
1657 switch(mode)
1658 {
1659 case PaddingMode::CONSTANT:
1660 os << "CONSTANT";
1661 break;
1662 case PaddingMode::REFLECT:
1663 os << "REFLECT";
1664 break;
1665 case PaddingMode::SYMMETRIC:
1666 os << "SYMMETRIC";
1667 break;
1668 default:
1669 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1670 }
1671
1672 return os;
1673}
1674
1675/** Formatted output of the PaddingMode type.
1676 *
1677 * @param[in] mode Type to output.
1678 *
1679 * @return Formatted string.
1680 */
1681inline std::string to_string(const PaddingMode &mode)
1682{
1683 std::stringstream str;
1684 str << mode;
1685 return str.str();
1686}
1687
Alex Gildayc357c472018-03-21 13:54:09 +00001688/** Formatted output of the PadStrideInfo type.
1689 *
1690 * @param[out] os Output stream.
1691 * @param[in] pad_stride_info Type to output.
1692 *
1693 * @return Modified output stream.
1694 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001695inline ::std::ostream &operator<<(::std::ostream &os, const PadStrideInfo &pad_stride_info)
1696{
1697 os << pad_stride_info.stride().first << "," << pad_stride_info.stride().second;
1698 os << ";";
Jaroslaw Rzepeckia1ed41f2017-10-13 11:13:58 +01001699 os << pad_stride_info.pad_left() << "," << pad_stride_info.pad_right() << ","
1700 << pad_stride_info.pad_top() << "," << pad_stride_info.pad_bottom();
Anthony Barbier2a07e182017-08-04 18:20:27 +01001701
1702 return os;
1703}
1704
Alex Gildayc357c472018-03-21 13:54:09 +00001705/** Formatted output of the PadStrideInfo type.
1706 *
1707 * @param[in] pad_stride_info Type to output.
1708 *
1709 * @return Formatted string.
1710 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001711inline std::string to_string(const PadStrideInfo &pad_stride_info)
1712{
1713 std::stringstream str;
1714 str << pad_stride_info;
1715 return str.str();
1716}
1717
Alex Gildayc357c472018-03-21 13:54:09 +00001718/** Formatted output of the BorderMode type.
1719 *
1720 * @param[in] mode Type to output.
1721 *
1722 * @return Formatted string.
1723 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001724inline std::string to_string(const BorderMode &mode)
1725{
1726 std::stringstream str;
1727 str << mode;
1728 return str.str();
1729}
1730
Alex Gildayc357c472018-03-21 13:54:09 +00001731/** Formatted output of the BorderSize type.
1732 *
1733 * @param[in] border Type to output.
1734 *
1735 * @return Formatted string.
1736 */
John Richardsonb482ce12017-09-18 12:44:01 +01001737inline std::string to_string(const BorderSize &border)
1738{
1739 std::stringstream str;
1740 str << border;
1741 return str.str();
1742}
1743
Giuseppe Rossinid7647d42018-07-17 18:13:13 +01001744/** Formatted output of the PaddingList type.
1745 *
1746 * @param[in] padding Type to output.
1747 *
1748 * @return Formatted string.
1749 */
1750inline std::string to_string(const PaddingList &padding)
1751{
1752 std::stringstream str;
1753 str << padding;
1754 return str.str();
1755}
1756
giuros013175fcf2018-11-21 09:59:17 +00001757/** Formatted output of the Multiples type.
1758 *
1759 * @param[in] multiples Type to output.
1760 *
1761 * @return Formatted string.
1762 */
1763inline std::string to_string(const Multiples &multiples)
1764{
1765 std::stringstream str;
1766 str << multiples;
1767 return str.str();
1768}
1769
Alex Gildayc357c472018-03-21 13:54:09 +00001770/** Formatted output of the InterpolationPolicy type.
1771 *
1772 * @param[in] policy Type to output.
1773 *
1774 * @return Formatted string.
1775 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001776inline std::string to_string(const InterpolationPolicy &policy)
1777{
1778 std::stringstream str;
1779 str << policy;
1780 return str.str();
1781}
1782
Alex Gildayc357c472018-03-21 13:54:09 +00001783/** Formatted output of the SamplingPolicy type.
1784 *
1785 * @param[in] policy Type to output.
1786 *
1787 * @return Formatted string.
1788 */
Daniil Efremov02bf80d2017-11-22 00:26:51 +07001789inline std::string to_string(const SamplingPolicy &policy)
1790{
1791 std::stringstream str;
1792 str << policy;
1793 return str.str();
1794}
1795
Alex Gildayc357c472018-03-21 13:54:09 +00001796/** Formatted output of the ConvertPolicy type.
1797 *
1798 * @param[out] os Output stream.
1799 * @param[in] policy Type to output.
1800 *
1801 * @return Modified output stream.
1802 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001803inline ::std::ostream &operator<<(::std::ostream &os, const ConvertPolicy &policy)
1804{
1805 switch(policy)
1806 {
1807 case ConvertPolicy::WRAP:
1808 os << "WRAP";
1809 break;
1810 case ConvertPolicy::SATURATE:
1811 os << "SATURATE";
1812 break;
1813 default:
1814 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1815 }
1816
1817 return os;
1818}
1819
1820inline std::string to_string(const ConvertPolicy &policy)
1821{
1822 std::stringstream str;
1823 str << policy;
1824 return str.str();
1825}
1826
giuros01164a2722018-11-20 18:34:46 +00001827/** Formatted output of the ArithmeticOperation type.
1828 *
1829 * @param[out] os Output stream.
1830 * @param[in] op Operation to output.
1831 *
1832 * @return Modified output stream.
1833 */
1834inline ::std::ostream &operator<<(::std::ostream &os, const ArithmeticOperation &op)
1835{
1836 switch(op)
1837 {
1838 case ArithmeticOperation::ADD:
1839 os << "ADD";
1840 break;
1841 case ArithmeticOperation::SUB:
1842 os << "SUB";
1843 break;
1844 case ArithmeticOperation::DIV:
1845 os << "DIV";
1846 break;
1847 case ArithmeticOperation::MAX:
1848 os << "MAX";
1849 break;
1850 case ArithmeticOperation::MIN:
1851 os << "MIN";
1852 break;
1853 case ArithmeticOperation::SQUARED_DIFF:
1854 os << "SQUARED_DIFF";
1855 break;
Usama Arif52c54f62019-05-14 10:22:36 +01001856 case ArithmeticOperation::POWER:
1857 os << "POWER";
1858 break;
giuros01164a2722018-11-20 18:34:46 +00001859 default:
1860 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1861 }
1862
1863 return os;
1864}
1865
1866/** Formatted output of the Arithmetic Operation
1867 *
1868 * @param[in] op Type to output.
1869 *
1870 * @return Formatted string.
1871 */
1872inline std::string to_string(const ArithmeticOperation &op)
1873{
1874 std::stringstream str;
1875 str << op;
1876 return str.str();
1877}
1878
Alex Gildayc357c472018-03-21 13:54:09 +00001879/** Formatted output of the Reduction Operations.
1880 *
1881 * @param[out] os Output stream.
1882 * @param[in] op Type to output.
1883 *
1884 * @return Modified output stream.
1885 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001886inline ::std::ostream &operator<<(::std::ostream &os, const ReductionOperation &op)
1887{
1888 switch(op)
1889 {
Michalis Spyrou7e9391b2018-10-05 14:49:28 +01001890 case ReductionOperation::SUM:
1891 os << "SUM";
1892 break;
Anthony Barbier2a07e182017-08-04 18:20:27 +01001893 case ReductionOperation::SUM_SQUARE:
1894 os << "SUM_SQUARE";
1895 break;
Michalis Spyrou7e9391b2018-10-05 14:49:28 +01001896 case ReductionOperation::MEAN_SUM:
1897 os << "MEAN_SUM";
1898 break;
Michalis Spyrou7930db42018-11-22 17:36:28 +00001899 case ReductionOperation::ARG_IDX_MAX:
1900 os << "ARG_IDX_MAX";
1901 break;
1902 case ReductionOperation::ARG_IDX_MIN:
1903 os << "ARG_IDX_MIN";
1904 break;
Manuel Bottinib412fab2018-12-10 17:40:23 +00001905 case ReductionOperation::PROD:
1906 os << "PROD";
1907 break;
Usama Arifa4a08ad2019-05-20 12:38:33 +01001908 case ReductionOperation::MIN:
1909 os << "MIN";
1910 break;
Usama Arif28f0dd92019-05-20 13:44:34 +01001911 case ReductionOperation::MAX:
1912 os << "MAX";
1913 break;
Anthony Barbier2a07e182017-08-04 18:20:27 +01001914 default:
1915 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1916 }
1917
1918 return os;
1919}
1920
Alex Gildayc357c472018-03-21 13:54:09 +00001921/** Formatted output of the Reduction Operations.
1922 *
1923 * @param[in] op Type to output.
1924 *
1925 * @return Formatted string.
1926 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01001927inline std::string to_string(const ReductionOperation &op)
1928{
1929 std::stringstream str;
1930 str << op;
1931 return str.str();
1932}
1933
Georgios Pinitas7900a9e2018-11-23 11:44:58 +00001934/** Formatted output of the Comparison Operations.
1935 *
1936 * @param[out] os Output stream.
1937 * @param[in] op Type to output.
1938 *
1939 * @return Modified output stream.
1940 */
1941inline ::std::ostream &operator<<(::std::ostream &os, const ComparisonOperation &op)
1942{
1943 switch(op)
1944 {
1945 case ComparisonOperation::Equal:
1946 os << "Equal";
1947 break;
1948 case ComparisonOperation::NotEqual:
1949 os << "NotEqual";
1950 break;
1951 case ComparisonOperation::Greater:
1952 os << "Greater";
1953 break;
1954 case ComparisonOperation::GreaterEqual:
1955 os << "GreaterEqual";
1956 break;
1957 case ComparisonOperation::Less:
1958 os << "Less";
1959 break;
1960 case ComparisonOperation::LessEqual:
1961 os << "LessEqual";
1962 break;
1963 default:
1964 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1965 }
1966
1967 return os;
1968}
1969
Michalis Spyroue9362622018-11-23 17:41:37 +00001970/** Formatted output of the Elementwise unary Operations.
1971 *
1972 * @param[out] os Output stream.
1973 * @param[in] op Type to output.
1974 *
1975 * @return Modified output stream.
1976 */
1977inline ::std::ostream &operator<<(::std::ostream &os, const ElementWiseUnary &op)
1978{
1979 switch(op)
1980 {
1981 case ElementWiseUnary::RSQRT:
1982 os << "RSQRT";
1983 break;
1984 case ElementWiseUnary::EXP:
1985 os << "EXP";
1986 break;
Usama Arifeb312ef2019-05-13 17:45:54 +01001987 case ElementWiseUnary::NEG:
1988 os << "NEG";
1989 break;
Usama Arifac33d7e2019-05-20 14:21:40 +01001990 case ElementWiseUnary::LOG:
1991 os << "LOG";
1992 break;
ramelg01b1ba1e32021-09-25 11:53:26 +01001993 case ElementWiseUnary::SIN:
1994 os << "SIN";
1995 break;
1996 case ElementWiseUnary::ABS:
1997 os << "ABS";
1998 break;
Usama Arif6a4d5422019-05-24 14:53:59 +01001999 case ElementWiseUnary::ROUND:
2000 os << "ROUND";
2001 break;
ramelg01b1ba1e32021-09-25 11:53:26 +01002002 case ElementWiseUnary::LOGICAL_NOT:
2003 os << "LOGICAL_NOT";
2004 break;
Michalis Spyroue9362622018-11-23 17:41:37 +00002005 default:
2006 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2007 }
2008
2009 return os;
2010}
2011
Georgios Pinitas7900a9e2018-11-23 11:44:58 +00002012/** Formatted output of the Comparison Operations.
2013 *
2014 * @param[in] op Type to output.
2015 *
2016 * @return Formatted string.
2017 */
2018inline std::string to_string(const ComparisonOperation &op)
2019{
2020 std::stringstream str;
2021 str << op;
2022 return str.str();
2023}
2024
Michalis Spyroue9362622018-11-23 17:41:37 +00002025/** Formatted output of the Elementwise unary Operations.
2026 *
2027 * @param[in] op Type to output.
2028 *
2029 * @return Formatted string.
2030 */
2031inline std::string to_string(const ElementWiseUnary &op)
2032{
2033 std::stringstream str;
2034 str << op;
2035 return str.str();
2036}
2037
Alex Gildayc357c472018-03-21 13:54:09 +00002038/** Formatted output of the Norm Type.
2039 *
2040 * @param[in] type Type to output.
2041 *
2042 * @return Formatted string.
2043 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01002044inline std::string to_string(const NormType &type)
2045{
2046 std::stringstream str;
2047 str << type;
2048 return str.str();
2049}
2050
Alex Gildayc357c472018-03-21 13:54:09 +00002051/** Formatted output of the Pooling Type.
2052 *
2053 * @param[in] type Type to output.
2054 *
2055 * @return Formatted string.
2056 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01002057inline std::string to_string(const PoolingType &type)
2058{
2059 std::stringstream str;
2060 str << type;
2061 return str.str();
2062}
2063
Alex Gildayc357c472018-03-21 13:54:09 +00002064/** Formatted output of the Pooling Layer Info.
2065 *
2066 * @param[in] info Type to output.
2067 *
2068 * @return Formatted string.
2069 */
Anthony Barbier2a07e182017-08-04 18:20:27 +01002070inline std::string to_string(const PoolingLayerInfo &info)
2071{
2072 std::stringstream str;
Sang-Hoon Park0cb3da62020-01-15 12:39:56 +00002073 str << "{Type=" << info.pool_type << ","
Sang-Hoon Park11fedda2020-01-15 14:44:04 +00002074 << "DataLayout=" << info.data_layout << ","
Sang-Hoon Park0cb3da62020-01-15 12:39:56 +00002075 << "IsGlobalPooling=" << info.is_global_pooling;
2076 if(!info.is_global_pooling)
Georgios Pinitas4c2dd542017-11-13 12:58:41 +00002077 {
2078 str << ","
Sang-Hoon Park0cb3da62020-01-15 12:39:56 +00002079 << "PoolSize=" << info.pool_size.width << "," << info.pool_size.height << ","
2080 << "PadStride=" << info.pad_stride_info;
Georgios Pinitas4c2dd542017-11-13 12:58:41 +00002081 }
2082 str << "}";
Anthony Barbier2a07e182017-08-04 18:20:27 +01002083 return str.str();
2084}
2085
Michalis Spyrou6c7c38e2018-08-29 16:28:11 +01002086/** Formatted output of the PriorBoxLayerInfo.
2087 *
2088 * @param[in] info Type to output.
2089 *
2090 * @return Formatted string.
2091 */
2092inline std::string to_string(const PriorBoxLayerInfo &info)
2093{
2094 std::stringstream str;
2095 str << "{";
2096 str << "Clip:" << info.clip()
2097 << "Flip:" << info.flip()
2098 << "StepX:" << info.steps()[0]
2099 << "StepY:" << info.steps()[1]
2100 << "MinSizes:" << info.min_sizes().size()
2101 << "MaxSizes:" << info.max_sizes().size()
2102 << "ImgSizeX:" << info.img_size().x
2103 << "ImgSizeY:" << info.img_size().y
2104 << "Offset:" << info.offset()
2105 << "Variances:" << info.variances().size();
2106 str << "}";
2107 return str.str();
2108}
2109
Alex Gildayc357c472018-03-21 13:54:09 +00002110/** Formatted output of the Size2D type.
2111 *
2112 * @param[out] os Output stream
2113 * @param[in] size Type to output
2114 *
2115 * @return Modified output stream.
2116 */
John Richardson25f23682017-11-27 14:35:09 +00002117inline ::std::ostream &operator<<(::std::ostream &os, const Size2D &size)
2118{
2119 os << size.width << "x" << size.height;
2120
2121 return os;
2122}
2123
Alex Gildayc357c472018-03-21 13:54:09 +00002124/** Formatted output of the Size2D type.
2125 *
2126 * @param[in] type Type to output
2127 *
2128 * @return Formatted string.
2129 */
John Richardson25f23682017-11-27 14:35:09 +00002130inline std::string to_string(const Size2D &type)
2131{
2132 std::stringstream str;
2133 str << type;
2134 return str.str();
2135}
2136
Giorgio Arena945ae9e2021-10-13 11:13:04 +01002137/** Formatted output of the Size3D type.
2138 *
2139 * @param[out] os Output stream
2140 * @param[in] size Type to output
2141 *
2142 * @return Modified output stream.
2143 */
2144inline ::std::ostream &operator<<(::std::ostream &os, const Size3D &size)
2145{
2146 os << size.width << "x" << size.height << "x" << size.depth;
2147
2148 return os;
2149}
2150
2151/** Formatted output of the Size2D type.
2152 *
2153 * @param[in] type Type to output
2154 *
2155 * @return Formatted string.
2156 */
2157inline std::string to_string(const Size3D &type)
2158{
2159 std::stringstream str;
2160 str << type;
2161 return str.str();
2162}
2163
Alex Gildayc357c472018-03-21 13:54:09 +00002164/** Formatted output of the ConvolutionMethod type.
2165 *
2166 * @param[out] os Output stream
2167 * @param[in] conv_method Type to output
2168 *
2169 * @return Modified output stream.
2170 */
Isabella Gottardif07d28d2018-02-06 14:52:43 +00002171inline ::std::ostream &operator<<(::std::ostream &os, const ConvolutionMethod &conv_method)
2172{
2173 switch(conv_method)
2174 {
2175 case ConvolutionMethod::GEMM:
2176 os << "GEMM";
2177 break;
2178 case ConvolutionMethod::DIRECT:
2179 os << "DIRECT";
2180 break;
2181 case ConvolutionMethod::WINOGRAD:
2182 os << "WINOGRAD";
2183 break;
SiCongLid9287352021-11-03 19:01:22 +00002184 case ConvolutionMethod::FFT:
2185 os << "FFT";
2186 break;
2187 case ConvolutionMethod::GEMM_CONV2D:
2188 os << "GEMM_CONV2D";
2189 break;
Isabella Gottardif07d28d2018-02-06 14:52:43 +00002190 default:
2191 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2192 }
2193
2194 return os;
2195}
2196
Alex Gildayc357c472018-03-21 13:54:09 +00002197/** Formatted output of the ConvolutionMethod type.
2198 *
2199 * @param[in] conv_method Type to output
2200 *
2201 * @return Formatted string.
2202 */
Isabella Gottardif07d28d2018-02-06 14:52:43 +00002203inline std::string to_string(const ConvolutionMethod &conv_method)
2204{
2205 std::stringstream str;
2206 str << conv_method;
2207 return str.str();
2208}
2209
Alex Gildayc357c472018-03-21 13:54:09 +00002210/** Formatted output of the GPUTarget type.
2211 *
2212 * @param[out] os Output stream
2213 * @param[in] gpu_target Type to output
2214 *
2215 * @return Modified output stream.
2216 */
Isabella Gottardif07d28d2018-02-06 14:52:43 +00002217inline ::std::ostream &operator<<(::std::ostream &os, const GPUTarget &gpu_target)
2218{
2219 switch(gpu_target)
2220 {
2221 case GPUTarget::GPU_ARCH_MASK:
2222 os << "GPU_ARCH_MASK";
2223 break;
2224 case GPUTarget::MIDGARD:
2225 os << "MIDGARD";
2226 break;
2227 case GPUTarget::BIFROST:
2228 os << "BIFROST";
2229 break;
Georgios Pinitasd5462ff2019-07-03 19:33:57 +01002230 case GPUTarget::VALHALL:
2231 os << "VALHALL";
2232 break;
Isabella Gottardif07d28d2018-02-06 14:52:43 +00002233 case GPUTarget::T600:
2234 os << "T600";
2235 break;
2236 case GPUTarget::T700:
2237 os << "T700";
2238 break;
2239 case GPUTarget::T800:
2240 os << "T800";
2241 break;
Michalis Spyroua9676112018-02-22 18:07:43 +00002242 case GPUTarget::G71:
2243 os << "G71";
2244 break;
2245 case GPUTarget::G72:
2246 os << "G72";
2247 break;
2248 case GPUTarget::G51:
2249 os << "G51";
2250 break;
2251 case GPUTarget::G51BIG:
2252 os << "G51BIG";
2253 break;
2254 case GPUTarget::G51LIT:
2255 os << "G51LIT";
2256 break;
Georgios Pinitasb03f7c52018-07-12 10:49:53 +01002257 case GPUTarget::G76:
2258 os << "G76";
Michalis Spyroua9676112018-02-22 18:07:43 +00002259 break;
Georgios Pinitasd5462ff2019-07-03 19:33:57 +01002260 case GPUTarget::G77:
2261 os << "G77";
Michalis Spyroua9676112018-02-22 18:07:43 +00002262 break;
Georgios Pinitas4ffc42a2020-12-01 16:28:24 +00002263 case GPUTarget::G78:
2264 os << "G78";
Isabella Gottardif07d28d2018-02-06 14:52:43 +00002265 break;
Pablo Marquez Tellob1496e62021-06-25 14:49:37 +01002266 case GPUTarget::G31:
2267 os << "G31";
2268 break;
Gian Marco Iodiceab2bc732022-01-19 10:06:45 +00002269 case GPUTarget::G710:
2270 os << "G710";
Georgios Pinitasd5462ff2019-07-03 19:33:57 +01002271 break;
Isabella Gottardif07d28d2018-02-06 14:52:43 +00002272 default:
2273 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2274 }
2275
2276 return os;
2277}
2278
Alex Gildayc357c472018-03-21 13:54:09 +00002279/** Formatted output of the GPUTarget type.
2280 *
2281 * @param[in] gpu_target Type to output
2282 *
2283 * @return Formatted string.
2284 */
Isabella Gottardif07d28d2018-02-06 14:52:43 +00002285inline std::string to_string(const GPUTarget &gpu_target)
2286{
2287 std::stringstream str;
2288 str << gpu_target;
2289 return str.str();
2290}
Gian Marco Iodice247f52c2018-03-22 11:24:56 +00002291
John Richardson8de92612018-02-22 14:09:31 +00002292/** Formatted output of the DetectionWindow type.
2293 *
2294 * @param[out] os Output stream
2295 * @param[in] detection_window Type to output
2296 *
2297 * @return Modified output stream.
2298 */
John Richardson684cb0f2018-01-09 11:17:00 +00002299inline ::std::ostream &operator<<(::std::ostream &os, const DetectionWindow &detection_window)
2300{
2301 os << "{x=" << detection_window.x << ","
2302 << "y=" << detection_window.y << ","
2303 << "width=" << detection_window.width << ","
2304 << "height=" << detection_window.height << ","
2305 << "idx_class=" << detection_window.idx_class << ","
2306 << "score=" << detection_window.score << "}";
2307
2308 return os;
2309}
2310
Isabella Gottardi05e56442018-11-16 11:26:52 +00002311/** Formatted output of the DetectionOutputLayerCodeType type.
2312 *
2313 * @param[out] os Output stream
2314 * @param[in] detection_code Type to output
2315 *
2316 * @return Modified output stream.
2317 */
2318inline ::std::ostream &operator<<(::std::ostream &os, const DetectionOutputLayerCodeType &detection_code)
2319{
2320 switch(detection_code)
2321 {
2322 case DetectionOutputLayerCodeType::CENTER_SIZE:
2323 os << "CENTER_SIZE";
2324 break;
2325 case DetectionOutputLayerCodeType::CORNER:
2326 os << "CORNER";
2327 break;
2328 case DetectionOutputLayerCodeType::CORNER_SIZE:
2329 os << "CORNER_SIZE";
2330 break;
2331 case DetectionOutputLayerCodeType::TF_CENTER:
2332 os << "TF_CENTER";
2333 break;
2334 default:
2335 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2336 }
2337
2338 return os;
2339}
2340/** Formatted output of the DetectionOutputLayerCodeType type.
2341 *
2342 * @param[in] detection_code Type to output
2343 *
2344 * @return Formatted string.
2345 */
2346inline std::string to_string(const DetectionOutputLayerCodeType &detection_code)
2347{
2348 std::stringstream str;
2349 str << detection_code;
2350 return str.str();
2351}
2352
2353/** Formatted output of the DetectionOutputLayerInfo type.
2354 *
2355 * @param[out] os Output stream
2356 * @param[in] detection_info Type to output
2357 *
2358 * @return Modified output stream.
2359 */
2360inline ::std::ostream &operator<<(::std::ostream &os, const DetectionOutputLayerInfo &detection_info)
2361{
2362 os << "{Classes=" << detection_info.num_classes() << ","
2363 << "ShareLocation=" << detection_info.share_location() << ","
2364 << "CodeType=" << detection_info.code_type() << ","
2365 << "VarianceEncodedInTarget=" << detection_info.variance_encoded_in_target() << ","
2366 << "KeepTopK=" << detection_info.keep_top_k() << ","
2367 << "NMSThreshold=" << detection_info.nms_threshold() << ","
2368 << "Eta=" << detection_info.eta() << ","
2369 << "BackgroundLabelId=" << detection_info.background_label_id() << ","
2370 << "ConfidenceThreshold=" << detection_info.confidence_threshold() << ","
2371 << "TopK=" << detection_info.top_k() << ","
2372 << "NumLocClasses=" << detection_info.num_loc_classes()
2373 << "}";
2374
2375 return os;
2376}
2377
2378/** Formatted output of the DetectionOutputLayerInfo type.
2379 *
2380 * @param[in] detection_info Type to output
2381 *
2382 * @return Formatted string.
2383 */
2384inline std::string to_string(const DetectionOutputLayerInfo &detection_info)
2385{
2386 std::stringstream str;
2387 str << detection_info;
2388 return str.str();
2389}
Isabella Gottardia7acb3c2019-01-08 13:48:44 +00002390/** Formatted output of the DetectionPostProcessLayerInfo type.
2391 *
2392 * @param[out] os Output stream
2393 * @param[in] detection_info Type to output
2394 *
2395 * @return Modified output stream.
2396 */
2397inline ::std::ostream &operator<<(::std::ostream &os, const DetectionPostProcessLayerInfo &detection_info)
2398{
2399 os << "{MaxDetections=" << detection_info.max_detections() << ","
2400 << "MaxClassesPerDetection=" << detection_info.max_classes_per_detection() << ","
2401 << "NmsScoreThreshold=" << detection_info.nms_score_threshold() << ","
2402 << "NmsIouThreshold=" << detection_info.iou_threshold() << ","
2403 << "NumClasses=" << detection_info.num_classes() << ","
2404 << "ScaleValue_y=" << detection_info.scale_value_y() << ","
2405 << "ScaleValue_x=" << detection_info.scale_value_x() << ","
2406 << "ScaleValue_h=" << detection_info.scale_value_h() << ","
2407 << "ScaleValue_w=" << detection_info.scale_value_w() << ","
2408 << "UseRegularNms=" << detection_info.use_regular_nms() << ","
2409 << "DetectionPerClass=" << detection_info.detection_per_class()
2410 << "}";
2411
2412 return os;
2413}
2414
2415/** Formatted output of the DetectionPostProcessLayerInfo type.
2416 *
2417 * @param[in] detection_info Type to output
2418 *
2419 * @return Formatted string.
2420 */
2421inline std::string to_string(const DetectionPostProcessLayerInfo &detection_info)
2422{
2423 std::stringstream str;
2424 str << detection_info;
2425 return str.str();
2426}
Georgios Pinitasc6f95102021-03-30 10:03:01 +01002427
John Richardson8de92612018-02-22 14:09:31 +00002428/** Formatted output of the DetectionWindow type.
2429 *
2430 * @param[in] detection_window Type to output
2431 *
2432 * @return Formatted string.
2433 */
2434inline std::string to_string(const DetectionWindow &detection_window)
2435{
2436 std::stringstream str;
2437 str << detection_window;
2438 return str.str();
2439}
2440
Michalis Spyrou6c7c38e2018-08-29 16:28:11 +01002441/** Formatted output of @ref PriorBoxLayerInfo.
2442 *
2443 * @param[out] os Output stream.
2444 * @param[in] info Type to output.
2445 *
2446 * @return Modified output stream.
2447 */
2448inline ::std::ostream &operator<<(::std::ostream &os, const PriorBoxLayerInfo &info)
2449{
2450 os << "Clip:" << info.clip()
2451 << "Flip:" << info.flip()
2452 << "StepX:" << info.steps()[0]
2453 << "StepY:" << info.steps()[1]
2454 << "MinSizes:" << info.min_sizes()
2455 << "MaxSizes:" << info.max_sizes()
2456 << "ImgSizeX:" << info.img_size().x
2457 << "ImgSizeY:" << info.img_size().y
2458 << "Offset:" << info.offset()
2459 << "Variances:" << info.variances();
2460
2461 return os;
2462}
2463
Gian Marco Iodice247f52c2018-03-22 11:24:56 +00002464/** Formatted output of the WinogradInfo type. */
2465inline ::std::ostream &operator<<(::std::ostream &os, const WinogradInfo &info)
2466{
2467 os << "{OutputTileSize=" << info.output_tile_size << ","
2468 << "KernelSize=" << info.kernel_size << ","
2469 << "PadStride=" << info.convolution_info << ","
2470 << "OutputDataLayout=" << info.output_data_layout << "}";
2471
2472 return os;
2473}
2474
Gian Marco Iodice247f52c2018-03-22 11:24:56 +00002475inline std::string to_string(const WinogradInfo &type)
2476{
2477 std::stringstream str;
2478 str << type;
2479 return str.str();
2480}
Anthony Barbier671a11e2018-07-06 15:11:36 +01002481
Vidhya Sudhan Loganathan050471e2019-04-25 09:27:24 +01002482/** Convert a CLTunerMode value to a string
2483 *
2484 * @param val CLTunerMode value to be converted
2485 *
2486 * @return String representing the corresponding CLTunerMode.
2487 */
2488inline std::string to_string(const CLTunerMode val)
2489{
2490 switch(val)
2491 {
2492 case CLTunerMode::EXHAUSTIVE:
2493 {
2494 return std::string("Exhaustive");
2495 }
2496 case CLTunerMode::NORMAL:
2497 {
2498 return std::string("Normal");
2499 }
2500 case CLTunerMode::RAPID:
2501 {
2502 return std::string("Rapid");
2503 }
2504 default:
2505 {
2506 ARM_COMPUTE_ERROR("Invalid tuner mode.");
2507 return std::string("UNDEFINED");
2508 }
2509 }
2510}
SiCong Lidb4a6c12021-02-05 09:30:57 +00002511/** Converts a @ref CLGEMMKernelType to string
2512 *
2513 * @param[in] val CLGEMMKernelType value to be converted
2514 *
2515 * @return String representing the corresponding CLGEMMKernelType
2516 */
2517inline std::string to_string(CLGEMMKernelType val)
2518{
2519 switch(val)
2520 {
SiCong Lidb4a6c12021-02-05 09:30:57 +00002521 case CLGEMMKernelType::NATIVE:
2522 {
2523 return "Native";
2524 }
2525 case CLGEMMKernelType::RESHAPED_ONLY_RHS:
2526 {
2527 return "Reshaped_Only_RHS";
2528 }
2529 case CLGEMMKernelType::RESHAPED:
2530 {
2531 return "Reshaped";
2532 }
2533 default:
2534 {
2535 return "Unknown";
2536 }
2537 }
2538}
Vidhya Sudhan Loganathan050471e2019-04-25 09:27:24 +01002539/** [Print CLTunerMode type] **/
2540/** Formatted output of the CLTunerMode type.
2541 *
2542 * @param[out] os Output stream.
2543 * @param[in] val CLTunerMode to output.
2544 *
2545 * @return Modified output stream.
2546 */
2547inline ::std::ostream &operator<<(::std::ostream &os, const CLTunerMode &val)
2548{
2549 os << to_string(val);
2550 return os;
2551}
2552
ramelg013ae3d882021-09-12 23:07:47 +01002553/** Formatted output of the ConvolutionInfo type.
2554 *
2555 * @param[out] os Output stream.
2556 * @param[in] conv_info ConvolutionInfo to output.
2557 *
2558 * @return Modified output stream.
2559 */
2560inline ::std::ostream &operator<<(::std::ostream &os, const ConvolutionInfo &conv_info)
2561{
SiCongLi579ca842021-10-18 09:38:33 +01002562 os << "{PadStrideInfo=" << conv_info.pad_stride_info << ", "
2563 << "depth_multiplier=" << conv_info.depth_multiplier << ", "
2564 << "act_info=" << to_string(conv_info.act_info) << ", "
2565 << "dilation=" << conv_info.dilation << "}";
ramelg013ae3d882021-09-12 23:07:47 +01002566 return os;
2567}
2568
2569/** Converts a @ref ConvolutionInfo to string
2570 *
2571 * @param[in] info ConvolutionInfo value to be converted
2572 *
2573 * @return String representing the corresponding ConvolutionInfo
2574 */
2575inline std::string to_string(const ConvolutionInfo &info)
2576{
2577 std::stringstream str;
2578 str << info;
2579 return str.str();
2580}
2581
2582/** Formatted output of the FullyConnectedLayerInfo type.
2583 *
2584 * @param[out] os Output stream.
2585 * @param[in] layer_info FullyConnectedLayerInfo to output.
2586 *
2587 * @return Modified output stream.
2588 */
2589inline ::std::ostream &operator<<(::std::ostream &os, const FullyConnectedLayerInfo &layer_info)
2590{
SiCongLi579ca842021-10-18 09:38:33 +01002591 os << "{activation_info=" << to_string(layer_info.activation_info) << ", "
2592 << "weights_trained_layout=" << layer_info.weights_trained_layout << ", "
2593 << "transpose_weights=" << layer_info.transpose_weights << ", "
2594 << "are_weights_reshaped=" << layer_info.are_weights_reshaped << ", "
2595 << "retain_internal_weights=" << layer_info.retain_internal_weights << ", "
2596 << "constant_weights=" << layer_info.transpose_weights << ", "
2597 << "fp_mixed_precision=" << layer_info.fp_mixed_precision << "}";
ramelg013ae3d882021-09-12 23:07:47 +01002598 return os;
2599}
2600
2601/** Converts a @ref FullyConnectedLayerInfo to string
2602 *
2603 * @param[in] info FullyConnectedLayerInfo value to be converted
2604 *
2605 * @return String representing the corresponding FullyConnectedLayerInfo
2606 */
2607inline std::string to_string(const FullyConnectedLayerInfo &info)
2608{
2609 std::stringstream str;
2610 str << info;
2611 return str.str();
2612}
2613
2614/** Formatted output of the GEMMLowpOutputStageType type.
2615 *
2616 * @param[out] os Output stream.
2617 * @param[in] gemm_type GEMMLowpOutputStageType to output.
2618 *
2619 * @return Modified output stream.
2620 */
2621inline ::std::ostream &operator<<(::std::ostream &os, const GEMMLowpOutputStageType &gemm_type)
2622{
2623 switch(gemm_type)
2624 {
2625 case GEMMLowpOutputStageType::NONE:
2626 os << "NONE";
2627 break;
2628 case GEMMLowpOutputStageType::QUANTIZE_DOWN:
2629 os << "QUANTIZE_DOWN";
2630 break;
2631 case GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT:
2632 os << "QUANTIZE_DOWN_FIXEDPOINT";
2633 break;
2634 case GEMMLowpOutputStageType::QUANTIZE_DOWN_FLOAT:
2635 os << "QUANTIZE_DOWN_FLOAT";
2636 break;
2637 default:
2638 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2639 }
2640 return os;
2641}
2642
2643/** Converts a @ref GEMMLowpOutputStageType to string
2644 *
2645 * @param[in] gemm_type GEMMLowpOutputStageType value to be converted
2646 *
2647 * @return String representing the corresponding GEMMLowpOutputStageType
2648 */
2649inline std::string to_string(const GEMMLowpOutputStageType &gemm_type)
2650{
2651 std::stringstream str;
2652 str << gemm_type;
2653 return str.str();
2654}
2655
2656/** Formatted output of the GEMMLowpOutputStageInfo type.
2657 *
2658 * @param[out] os Output stream.
2659 * @param[in] gemm_info GEMMLowpOutputStageInfo to output.
2660 *
2661 * @return Modified output stream.
2662 */
2663inline ::std::ostream &operator<<(::std::ostream &os, const GEMMLowpOutputStageInfo &gemm_info)
2664{
SiCongLi579ca842021-10-18 09:38:33 +01002665 os << "{type=" << gemm_info.type << ", "
2666 << "gemlowp_offset=" << gemm_info.gemmlowp_offset << ", "
2667 << "gemmlowp_multiplier=" << gemm_info.gemmlowp_multiplier << ", "
2668 << "gemmlowp_shift=" << gemm_info.gemmlowp_shift << ", "
2669 << "gemmlowp_min_bound=" << gemm_info.gemmlowp_min_bound << ", "
2670 << "gemmlowp_max_bound=" << gemm_info.gemmlowp_max_bound << ", "
2671 << "gemmlowp_multipliers=" << gemm_info.gemmlowp_multiplier << ", "
2672 << "gemmlowp_shifts=" << gemm_info.gemmlowp_shift << ", "
2673 << "gemmlowp_real_multiplier=" << gemm_info.gemmlowp_real_multiplier << ", "
2674 << "is_quantized_per_channel=" << gemm_info.is_quantized_per_channel << ", "
2675 << "output_data_type=" << gemm_info.output_data_type << "}";
ramelg013ae3d882021-09-12 23:07:47 +01002676 return os;
2677}
2678
2679/** Converts a @ref GEMMLowpOutputStageInfo to string
2680 *
2681 * @param[in] gemm_info GEMMLowpOutputStageInfo value to be converted
2682 *
2683 * @return String representing the corresponding GEMMLowpOutputStageInfo
2684 */
2685inline std::string to_string(const GEMMLowpOutputStageInfo &gemm_info)
2686{
2687 std::stringstream str;
2688 str << gemm_info;
2689 return str.str();
2690}
2691
2692/** Formatted output of the Conv2dInfo type.
2693 *
2694 * @param[out] os Output stream.
2695 * @param[in] conv_info Conv2dInfo to output.
2696 *
2697 * @return Modified output stream.
2698 */
2699inline ::std::ostream &operator<<(::std::ostream &os, const Conv2dInfo &conv_info)
2700{
SiCongLi579ca842021-10-18 09:38:33 +01002701 os << "{conv_info=" << conv_info.conv_info << ", "
2702 << "dilation=" << conv_info.dilation << ", "
2703 << "act_info=" << to_string(conv_info.act_info) << ", "
2704 << "enable_fast_math=" << conv_info.enable_fast_math << ", "
2705 << "num_groups=" << conv_info.num_groups << ","
2706 << "post_ops=" << conv_info.post_ops << "}";
ramelg013ae3d882021-09-12 23:07:47 +01002707 return os;
2708}
2709
2710/** Converts a @ref Conv2dInfo to string
2711 *
2712 * @param[in] conv_info Conv2dInfo value to be converted
2713 *
2714 * @return String representing the corresponding Conv2dInfo
2715 */
2716inline std::string to_string(const Conv2dInfo &conv_info)
2717{
2718 std::stringstream str;
2719 str << conv_info;
2720 return str.str();
2721}
2722
2723/** Formatted output of the PixelValue type.
2724 *
2725 * @param[out] os Output stream.
2726 * @param[in] pixel_value PixelValue to output.
2727 *
2728 * @return Modified output stream.
2729 */
2730inline ::std::ostream &operator<<(::std::ostream &os, const PixelValue &pixel_value)
2731{
SiCongLi579ca842021-10-18 09:38:33 +01002732 os << "{value.u64=" << pixel_value.get<uint64_t>() << "}";
ramelg013ae3d882021-09-12 23:07:47 +01002733 return os;
2734}
2735
2736/** Converts a @ref PixelValue to string
2737 *
2738 * @param[in] pixel_value PixelValue value to be converted
2739 *
2740 * @return String representing the corresponding PixelValue
2741 */
2742inline std::string to_string(const PixelValue &pixel_value)
2743{
2744 std::stringstream str;
2745 str << pixel_value;
2746 return str.str();
2747}
2748
2749/** Formatted output of the ScaleKernelInfo type.
2750 *
2751 * @param[out] os Output stream.
2752 * @param[in] scale_info ScaleKernelInfo to output.
2753 *
2754 * @return Modified output stream.
2755 */
2756inline ::std::ostream &operator<<(::std::ostream &os, const ScaleKernelInfo &scale_info)
2757{
SiCongLi579ca842021-10-18 09:38:33 +01002758 os << "{interpolation_policy=" << scale_info.interpolation_policy << ", "
2759 << "BorderMode=" << scale_info.border_mode << ", "
2760 << "PixelValue=" << scale_info.constant_border_value << ", "
2761 << "SamplingPolicy=" << scale_info.sampling_policy << ", "
2762 << "use_padding=" << scale_info.use_padding << ", "
2763 << "align_corners=" << scale_info.align_corners << ", "
2764 << "data_layout=" << scale_info.data_layout << "}";
ramelg013ae3d882021-09-12 23:07:47 +01002765 return os;
2766}
2767
2768/** Converts a @ref ScaleKernelInfo to string
2769 *
2770 * @param[in] scale_info ScaleKernelInfo value to be converted
2771 *
2772 * @return String representing the corresponding ScaleKernelInfo
2773 */
2774inline std::string to_string(const ScaleKernelInfo &scale_info)
2775{
2776 std::stringstream str;
2777 str << scale_info;
2778 return str.str();
2779}
2780
2781/** Formatted output of the FFTDirection type.
2782 *
2783 * @param[out] os Output stream.
2784 * @param[in] fft_dir FFTDirection to output.
2785 *
2786 * @return Modified output stream.
2787 */
2788inline ::std::ostream &operator<<(::std::ostream &os, const FFTDirection &fft_dir)
2789{
2790 switch(fft_dir)
2791 {
2792 case FFTDirection::Forward:
2793 os << "Forward";
2794 break;
2795 case FFTDirection::Inverse:
2796 os << "Inverse";
2797 break;
2798 default:
2799 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2800 }
2801 return os;
2802}
2803
2804/** Converts a @ref FFT1DInfo to string
2805 *
2806 * @param[in] fft_dir FFT1DInfo value to be converted
2807 *
2808 * @return String representing the corresponding FFT1DInfo
2809 */
2810inline std::string to_string(const FFTDirection &fft_dir)
2811{
2812 std::stringstream str;
ramelg01cbbb0382021-09-17 17:36:57 +01002813 str << "{" << fft_dir << "}";
ramelg013ae3d882021-09-12 23:07:47 +01002814 return str.str();
2815}
2816
2817/** Formatted output of the FFT1DInfo type.
2818 *
2819 * @param[out] os Output stream.
2820 * @param[in] fft1d_info FFT1DInfo to output.
2821 *
2822 * @return Modified output stream.
2823 */
2824inline ::std::ostream &operator<<(::std::ostream &os, const FFT1DInfo &fft1d_info)
2825{
SiCongLi579ca842021-10-18 09:38:33 +01002826 os << "{axis=" << fft1d_info.axis << ", "
2827 << "direction=" << fft1d_info.direction << "}";
ramelg013ae3d882021-09-12 23:07:47 +01002828 return os;
2829}
2830
2831/** Converts a @ref FFT1DInfo to string
2832 *
2833 * @param[in] fft1d_info FFT1DInfo value to be converted
2834 *
2835 * @return String representing the corresponding FFT1DInfo
2836 */
2837inline std::string to_string(const FFT1DInfo &fft1d_info)
2838{
2839 std::stringstream str;
2840 str << fft1d_info;
2841 return str.str();
2842}
2843
2844/** Formatted output of the FFT2DInfo type.
2845 *
2846 * @param[out] os Output stream.
2847 * @param[in] fft2d_info FFT2DInfo to output.
2848 *
2849 * @return Modified output stream.
2850 */
2851inline ::std::ostream &operator<<(::std::ostream &os, const FFT2DInfo &fft2d_info)
2852{
SiCongLi579ca842021-10-18 09:38:33 +01002853 os << "{axis=" << fft2d_info.axis0 << ", "
2854 << "axis=" << fft2d_info.axis1 << ", "
2855 << "direction=" << fft2d_info.direction << "}";
ramelg013ae3d882021-09-12 23:07:47 +01002856 return os;
2857}
2858
2859/** Converts a @ref FFT2DInfo to string
2860 *
2861 * @param[in] fft2d_info FFT2DInfo value to be converted
2862 *
2863 * @return String representing the corresponding FFT2DInfo
2864 */
2865inline std::string to_string(const FFT2DInfo &fft2d_info)
2866{
2867 std::stringstream str;
2868 str << fft2d_info;
2869 return str.str();
2870}
2871
2872/** Formatted output of the Coordinates2D type.
2873 *
2874 * @param[out] os Output stream.
2875 * @param[in] coord_2d Coordinates2D to output.
2876 *
2877 * @return Modified output stream.
2878 */
2879inline ::std::ostream &operator<<(::std::ostream &os, const Coordinates2D &coord_2d)
2880{
SiCongLi579ca842021-10-18 09:38:33 +01002881 os << "{x=" << coord_2d.x << ", "
2882 << "y=" << coord_2d.y << "}";
ramelg013ae3d882021-09-12 23:07:47 +01002883 return os;
2884}
2885
2886/** Converts a @ref Coordinates2D to string
2887 *
2888 * @param[in] coord_2d Coordinates2D value to be converted
2889 *
2890 * @return String representing the corresponding Coordinates2D
2891 */
2892inline std::string to_string(const Coordinates2D &coord_2d)
2893{
2894 std::stringstream str;
2895 str << coord_2d;
2896 return str.str();
2897}
2898
2899/** Formatted output of the FuseBatchNormalizationType type.
2900 *
2901 * @param[out] os Output stream.
2902 * @param[in] fuse_type FuseBatchNormalizationType to output.
2903 *
2904 * @return Modified output stream.
2905 */
2906inline ::std::ostream &operator<<(::std::ostream &os, const FuseBatchNormalizationType &fuse_type)
2907{
2908 switch(fuse_type)
2909 {
2910 case FuseBatchNormalizationType::CONVOLUTION:
2911 os << "CONVOLUTION";
2912 break;
2913 case FuseBatchNormalizationType::DEPTHWISECONVOLUTION:
2914 os << "DEPTHWISECONVOLUTION";
2915 break;
2916 default:
2917 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2918 }
2919 return os;
2920}
2921
2922/** Converts a @ref FuseBatchNormalizationType to string
2923 *
2924 * @param[in] fuse_type FuseBatchNormalizationType value to be converted
2925 *
2926 * @return String representing the corresponding FuseBatchNormalizationType
2927 */
2928inline std::string to_string(const FuseBatchNormalizationType &fuse_type)
2929{
2930 std::stringstream str;
2931 str << fuse_type;
2932 return str.str();
2933}
2934
ramelg01cbbb0382021-09-17 17:36:57 +01002935/** Formatted output of the SoftmaxKernelInfo type.
2936 *
2937 * @param[out] os Output stream.
2938 * @param[in] info SoftmaxKernelInfo to output.
2939 *
2940 * @return Modified output stream.
2941 */
2942inline ::std::ostream &operator<<(::std::ostream &os, const SoftmaxKernelInfo &info)
2943{
SiCongLi579ca842021-10-18 09:38:33 +01002944 os << "{beta=" << info.beta << ", "
2945 << "is_log=" << info.is_log << ", "
2946 << "input_data_type=" << info.input_data_type << ", "
2947 << "axis=" << info.axis << "}";
ramelg01cbbb0382021-09-17 17:36:57 +01002948 return os;
2949}
2950
2951/** Converts a @ref SoftmaxKernelInfo to string
2952 *
2953 * @param[in] info SoftmaxKernelInfo value to be converted
2954 *
2955 * @return String representing the corresponding SoftmaxKernelInfo
2956 */
2957inline std::string to_string(const SoftmaxKernelInfo &info)
2958{
2959 std::stringstream str;
2960 str << info;
2961 return str.str();
2962}
2963
2964/** Formatted output of the ScaleKernelInfo type.
2965 *
2966 * @param[out] os Output stream.
2967 * @param[in] lstm_params LSTMParams to output.
2968 *
2969 * @return Modified output stream.
2970 */
2971template <typename T>
ramelg014a6d9e82021-10-02 14:34:36 +01002972::std::ostream &operator<<(::std::ostream &os, const LSTMParams<T> &lstm_params)
ramelg01cbbb0382021-09-17 17:36:57 +01002973{
ramelg014a6d9e82021-10-02 14:34:36 +01002974 os << "{input_to_input_weights=" << to_string(lstm_params.input_to_input_weights()) << ", "
2975 << "recurrent_to_input_weights=" << to_string(lstm_params.recurrent_to_input_weights()) << ", "
2976 << "cell_to_input_weights=" << to_string(lstm_params.cell_to_input_weights()) << ", "
2977 << "input_gate_bias=" << to_string(lstm_params.input_gate_bias()) << ", "
2978 << "cell_to_forget_weights=" << to_string(lstm_params.cell_to_forget_weights()) << ", "
2979 << "cell_to_output_weights=" << to_string(lstm_params.cell_to_output_weights()) << ", "
2980 << "projection_weights=" << to_string(lstm_params.projection_weights()) << ", "
2981 << "projection_bias=" << to_string(lstm_params.projection_bias()) << ", "
2982 << "input_layer_norm_weights=" << to_string(lstm_params.input_layer_norm_weights()) << ", "
2983 << "forget_layer_norm_weights=" << to_string(lstm_params.forget_layer_norm_weights()) << ", "
2984 << "cell_layer_norm_weights=" << to_string(lstm_params.cell_layer_norm_weights()) << ", "
2985 << "output_layer_norm_weights=" << to_string(lstm_params.output_layer_norm_weights()) << ", "
ramelg01cbbb0382021-09-17 17:36:57 +01002986 << "cell_clip=" << lstm_params.cell_clip() << ", "
2987 << "projection_clip=" << lstm_params.projection_clip() << ", "
2988 << "input_intermediate_scale=" << lstm_params.input_intermediate_scale() << ", "
2989 << "forget_intermediate_scale=" << lstm_params.forget_intermediate_scale() << ", "
2990 << "cell_intermediate_scale=" << lstm_params.cell_intermediate_scale() << ", "
2991 << "hidden_state_zero=" << lstm_params.hidden_state_zero() << ", "
2992 << "hidden_state_scale=" << lstm_params.hidden_state_scale() << ", "
2993 << "has_peephole_opt=" << lstm_params.has_peephole_opt() << ", "
2994 << "has_projection=" << lstm_params.has_projection() << ", "
2995 << "has_cifg_opt=" << lstm_params.has_cifg_opt() << ", "
2996 << "use_layer_norm=" << lstm_params.use_layer_norm() << "}";
2997 return os;
2998}
2999
3000/** Converts a @ref LSTMParams to string
3001 *
3002 * @param[in] lstm_params LSTMParams<T> value to be converted
3003 *
3004 * @return String representing the corresponding LSTMParams
3005 */
3006template <typename T>
ramelg014a6d9e82021-10-02 14:34:36 +01003007std::string to_string(const LSTMParams<T> &lstm_params)
ramelg01cbbb0382021-09-17 17:36:57 +01003008{
3009 std::stringstream str;
3010 str << lstm_params;
3011 return str.str();
3012}
3013
3014/** Converts a @ref LSTMParams to string
3015 *
3016 * @param[in] num uint8_t value to be converted
3017 *
3018 * @return String representing the corresponding uint8_t
3019 */
3020inline std::string to_string(const uint8_t num)
3021{
3022 // Explicity cast the uint8_t to signed integer and call the corresponding overloaded to_string() function.
3023 return ::std::to_string(static_cast<int>(num));
3024}
3025
ramelg014a6d9e82021-10-02 14:34:36 +01003026/** Available non maxima suppression types */
3027/** Formatted output of the NMSType type.
3028 *
3029 * @param[out] os Output stream.
3030 * @param[in] nms_type NMSType to output.
3031 *
3032 * @return Modified output stream.
3033 */
3034inline ::std::ostream &operator<<(::std::ostream &os, const NMSType &nms_type)
3035{
3036 switch(nms_type)
3037 {
3038 case NMSType::LINEAR:
3039 os << "LINEAR";
3040 break;
3041 case NMSType::GAUSSIAN:
3042 os << "GAUSSIAN";
3043 break;
3044 case NMSType::ORIGINAL:
3045 os << "ORIGINAL";
3046 break;
3047 default:
3048 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
3049 }
3050 return os;
3051}
3052
3053/** Converts a @ref NMSType to string
3054 *
3055 * @param[in] nms_type NMSType value to be converted
3056 *
3057 * @return String representing the corresponding NMSType
3058 */
3059inline std::string to_string(const NMSType nms_type)
3060{
3061 std::stringstream str;
3062 str << nms_type;
3063 return str.str();
3064}
3065
3066/** Formatted output of the BoxNMSLimitInfo type.
3067 *
3068 * @param[out] os Output stream.
3069 * @param[in] info BoxNMSLimitInfo to output.
3070 *
3071 * @return Modified output stream.
3072 */
3073inline ::std::ostream &operator<<(::std::ostream &os, const BoxNMSLimitInfo &info)
3074{
SiCongLi579ca842021-10-18 09:38:33 +01003075 os << "{score_thresh=" << info.score_thresh() << ", "
3076 << "nms=" << info.nms() << ", "
3077 << "detections_per_im=" << info.detections_per_im() << ", "
3078 << "soft_nms_enabled=" << info.soft_nms_enabled() << ", "
3079 << "soft_nms_min_score_thres=" << info.soft_nms_min_score_thres() << ", "
3080 << "suppress_size=" << info.suppress_size() << ", "
3081 << "min_size=" << info.min_size() << ", "
3082 << "im_width=" << info.im_width() << ", "
3083 << "im_height=" << info.im_height() << "}";
ramelg014a6d9e82021-10-02 14:34:36 +01003084 return os;
3085}
3086
3087/** Converts a @ref BoxNMSLimitInfo to string
3088 *
3089 * @param[in] info BoxNMSLimitInfo value to be converted
3090 *
3091 * @return String representing the corresponding BoxNMSLimitInfo
3092 */
3093inline std::string to_string(const BoxNMSLimitInfo &info)
3094{
3095 std::stringstream str;
3096 str << info;
3097 return str.str();
3098}
3099
Giorgio Arena945ae9e2021-10-13 11:13:04 +01003100/** Formatted output of the DimensionRoundingType type.
3101 *
3102 * @param[out] os Output stream.
3103 * @param[in] rounding_type DimensionRoundingType to output.
3104 *
3105 * @return Modified output stream.
3106 */
3107inline ::std::ostream &operator<<(::std::ostream &os, const DimensionRoundingType &rounding_type)
3108{
3109 switch(rounding_type)
3110 {
3111 case DimensionRoundingType::CEIL:
3112 os << "CEIL";
3113 break;
3114 case DimensionRoundingType::FLOOR:
3115 os << "FLOOR";
3116 break;
3117 default:
3118 ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
3119 }
3120 return os;
3121}
3122
3123/** Converts a @ref DimensionRoundingType to string
3124 *
3125 * @param[in] rounding_type DimensionRoundingType value to be converted
3126 *
3127 * @return String representing the corresponding DimensionRoundingType
3128 */
3129inline std::string to_string(const DimensionRoundingType &rounding_type)
3130{
3131 std::stringstream str;
3132 str << rounding_type;
3133 return str.str();
3134}
3135
3136/** Formatted output of the Padding3D type.
3137 *
3138 * @param[out] os Output stream.
3139 * @param[in] padding3d Padding3D to output.
3140 *
3141 * @return Modified output stream.
3142 */
3143inline ::std::ostream &operator<<(::std::ostream &os, const Padding3D &padding3d)
3144{
3145 os << padding3d.left << "," << padding3d.right << ","
3146 << padding3d.top << "," << padding3d.bottom << ","
3147 << padding3d.front << "," << padding3d.back;
3148 return os;
3149}
3150
3151/** Converts a @ref Padding3D to string
3152 *
3153 * @param[in] padding3d Padding3D value to be converted
3154 *
3155 * @return String representing the corresponding Padding3D
3156 */
3157inline std::string to_string(const Padding3D &padding3d)
3158{
3159 std::stringstream str;
3160 str << padding3d;
3161 return str.str();
3162}
3163
3164/** Formatted output of the Conv3dInfo type.
3165 *
3166 * @param[out] os Output stream.
3167 * @param[in] conv3d_info Type to output.
3168 *
3169 * @return Modified output stream.
3170 */
3171inline ::std::ostream &operator<<(::std::ostream &os, const Conv3dInfo &conv3d_info)
3172{
3173 os << conv3d_info.stride;
3174 os << ";";
3175 os << conv3d_info.padding;
3176 os << ";";
3177 os << to_string(conv3d_info.act_info);
3178 os << ";";
3179 os << conv3d_info.dilation;
3180 os << ";";
3181 os << conv3d_info.round_type;
3182 os << ";";
3183 os << conv3d_info.enable_fast_math;
3184
3185 return os;
3186}
3187
3188/** Formatted output of the Conv3dInfo type.
3189 *
3190 * @param[in] conv3d_info Type to output.
3191 *
3192 * @return Formatted string.
3193 */
3194inline std::string to_string(const Conv3dInfo &conv3d_info)
3195{
3196 std::stringstream str;
3197 str << conv3d_info;
3198 return str.str();
3199}
3200
Anthony Barbier6ff3b192017-09-04 18:44:23 +01003201} // namespace arm_compute
Anthony Barbier4dbc0a92018-08-27 13:39:47 +01003202
3203#endif /* __ARM_COMPUTE_TYPE_PRINTER_H__ */