Compute Library
 21.02
TypePrinter.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2021 Arm Limited.
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #ifndef __ARM_COMPUTE_TYPE_PRINTER_H__
25 #define __ARM_COMPUTE_TYPE_PRINTER_H__
26 
29 #include "arm_compute/core/Error.h"
36 #include "arm_compute/core/Types.h"
39 #include "support/StringSupport.h"
40 
41 #include <ostream>
42 #include <sstream>
43 #include <string>
44 
45 namespace arm_compute
46 {
47 /** Formatted output if arg is not null
48  *
49  * @param[in] arg Object to print
50  *
51  * @return String representing arg.
52  */
53 template <typename T>
54 std::string to_string_if_not_null(T *arg)
55 {
56  if(arg == nullptr)
57  {
58  return "nullptr";
59  }
60  else
61  {
62  return to_string(*arg);
63  }
64 }
65 
66 /** Formatted output of the Dimensions type.
67  *
68  * @param[out] os Output stream.
69  * @param[in] dimensions Type to output.
70  *
71  * @return Modified output stream.
72  */
73 template <typename T>
74 inline ::std::ostream &operator<<(::std::ostream &os, const Dimensions<T> &dimensions)
75 {
76  if(dimensions.num_dimensions() > 0)
77  {
78  os << dimensions[0];
79 
80  for(unsigned int d = 1; d < dimensions.num_dimensions(); ++d)
81  {
82  os << "x" << dimensions[d];
83  }
84  }
85 
86  return os;
87 }
88 
89 /** Formatted output of the NonLinearFilterFunction type.
90  *
91  * @param[out] os Output stream.
92  * @param[in] function Type to output.
93  *
94  * @return Modified output stream.
95  */
96 inline ::std::ostream &operator<<(::std::ostream &os, const NonLinearFilterFunction &function)
97 {
98  switch(function)
99  {
101  os << "MAX";
102  break;
104  os << "MEDIAN";
105  break;
107  os << "MIN";
108  break;
109  default:
110  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
111  }
112 
113  return os;
114 }
115 
116 /** Formatted output of the NonLinearFilterFunction type.
117  *
118  * @param[in] function Type to output.
119  *
120  * @return Formatted string.
121  */
122 inline std::string to_string(const NonLinearFilterFunction &function)
123 {
124  std::stringstream str;
125  str << function;
126  return str.str();
127 }
128 
129 /** Formatted output of the MatrixPattern type.
130  *
131  * @param[out] os Output stream.
132  * @param[in] pattern Type to output.
133  *
134  * @return Modified output stream.
135  */
136 inline ::std::ostream &operator<<(::std::ostream &os, const MatrixPattern &pattern)
137 {
138  switch(pattern)
139  {
140  case MatrixPattern::BOX:
141  os << "BOX";
142  break;
144  os << "CROSS";
145  break;
146  case MatrixPattern::DISK:
147  os << "DISK";
148  break;
150  os << "OTHER";
151  break;
152  default:
153  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
154  }
155 
156  return os;
157 }
158 
159 /** Formatted output of the MatrixPattern type.
160  *
161  * @param[in] pattern Type to output.
162  *
163  * @return Formatted string.
164  */
165 inline std::string to_string(const MatrixPattern &pattern)
166 {
167  std::stringstream str;
168  str << pattern;
169  return str.str();
170 }
171 
172 /** Formatted output of the RoundingPolicy type.
173  *
174  * @param[out] os Output stream.
175  * @param[in] rounding_policy Type to output.
176  *
177  * @return Modified output stream.
178  */
179 inline ::std::ostream &operator<<(::std::ostream &os, const RoundingPolicy &rounding_policy)
180 {
181  switch(rounding_policy)
182  {
184  os << "TO_ZERO";
185  break;
187  os << "TO_NEAREST_UP";
188  break;
190  os << "TO_NEAREST_EVEN";
191  break;
192  default:
193  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
194  }
195 
196  return os;
197 }
198 
199 /** Formatted output of the WeightsInfo type.
200  *
201  * @param[out] os Output stream.
202  * @param[in] weights_info Type to output.
203  *
204  * @return Modified output stream.
205  */
206 inline ::std::ostream &operator<<(::std::ostream &os, const WeightsInfo &weights_info)
207 {
208  os << weights_info.are_reshaped() << ";";
209  os << weights_info.num_kernels() << ";" << weights_info.kernel_size().first << "," << weights_info.kernel_size().second;
210 
211  return os;
212 }
213 
214 /** Formatted output of the ROIPoolingInfo type.
215  *
216  * @param[out] os Output stream.
217  * @param[in] pool_info Type to output.
218  *
219  * @return Modified output stream.
220  */
221 inline ::std::ostream &operator<<(::std::ostream &os, const ROIPoolingLayerInfo &pool_info)
222 {
223  os << pool_info.pooled_width() << "x" << pool_info.pooled_height() << "~" << pool_info.spatial_scale();
224  return os;
225 }
226 
227 /** Formatted output of the ROIPoolingInfo type.
228  *
229  * @param[in] pool_info Type to output.
230  *
231  * @return Formatted string.
232  */
233 inline std::string to_string(const ROIPoolingLayerInfo &pool_info)
234 {
235  std::stringstream str;
236  str << pool_info;
237  return str.str();
238 }
239 
240 /** Formatted output of the GEMMKernelInfo type.
241  *
242  * @param[out] os Output stream.
243  * @param[in] gemm_info Type to output.
244  *
245  * @return Modified output stream.
246  */
247 inline ::std::ostream &operator<<(::std::ostream &os, const GEMMKernelInfo &gemm_info)
248 {
249  os << "( m= " << gemm_info.m;
250  os << " n= " << gemm_info.n;
251  os << " k= " << gemm_info.k;
252  os << " depth_output_gemm3d= " << gemm_info.depth_output_gemm3d;
253  os << " reinterpret_input_as_3d= " << gemm_info.reinterpret_input_as_3d;
254  os << " broadcast_bias= " << gemm_info.broadcast_bias;
255  os << " fp_mixed_precision= " << gemm_info.fp_mixed_precision;
256  os << " mult_transpose1xW_width= " << gemm_info.mult_transpose1xW_width;
257  os << " mult_interleave4x4_height= " << gemm_info.mult_interleave4x4_height;
258  os << " a_offset = " << gemm_info.a_offset;
259  os << " b_offset = " << gemm_info.b_offset;
260  os << ")";
261  return os;
262 }
263 
264 /** Formatted output of the GEMMLHSMatrixInfo type.
265  *
266  * @param[out] os Output stream.
267  * @param[in] gemm_info Type to output.
268  *
269  * @return Modified output stream.
270  */
271 inline ::std::ostream &operator<<(::std::ostream &os, const GEMMLHSMatrixInfo &gemm_info)
272 {
273  os << "( m0= " << (unsigned int)gemm_info.m0 << " k0= " << gemm_info.k0 << " v0= " << gemm_info.v0 << " trans= " << gemm_info.transpose << " inter= " << gemm_info.interleave << "})";
274  return os;
275 }
276 
277 /** Formatted output of the GEMMRHSMatrixInfo type.
278  *
279  * @param[out] os Output stream.
280  * @param[in] gemm_info Type to output.
281  *
282  * @return Modified output stream.
283  */
284 inline ::std::ostream &operator<<(::std::ostream &os, const GEMMRHSMatrixInfo &gemm_info)
285 {
286  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=" <<
287  gemm_info.export_to_cl_image << "})";
288  return os;
289 }
290 
291 /** Formatted output of the GEMMRHSMatrixInfo type.
292  *
293  * @param[in] gemm_info GEMMRHSMatrixInfo to output.
294  *
295  * @return Formatted string.
296  */
297 inline std::string to_string(const GEMMRHSMatrixInfo &gemm_info)
298 {
299  std::stringstream str;
300  str << gemm_info;
301  return str.str();
302 }
303 
304 /** Formatted output of the GEMMLHSMatrixInfo type.
305  *
306  * @param[in] gemm_info GEMMLHSMatrixInfo to output.
307  *
308  * @return Formatted string.
309  */
310 inline std::string to_string(const GEMMLHSMatrixInfo &gemm_info)
311 {
312  std::stringstream str;
313  str << gemm_info;
314  return str.str();
315 }
316 
317 /** Formatted output of the GEMMKernelInfo type.
318  *
319  * @param[in] gemm_info GEMMKernelInfo Type to output.
320  *
321  * @return Formatted string.
322  */
323 inline std::string to_string(const GEMMKernelInfo &gemm_info)
324 {
325  std::stringstream str;
326  str << gemm_info;
327  return str.str();
328 }
329 
330 /** Formatted output of the BoundingBoxTransformInfo type.
331  *
332  * @param[out] os Output stream.
333  * @param[in] bbox_info Type to output.
334  *
335  * @return Modified output stream.
336  */
337 inline ::std::ostream &operator<<(::std::ostream &os, const BoundingBoxTransformInfo &bbox_info)
338 {
339  auto weights = bbox_info.weights();
340  os << "(" << bbox_info.img_width() << "x" << bbox_info.img_height() << ")~" << bbox_info.scale() << "(weights = {" << weights[0] << ", " << weights[1] << ", " << weights[2] << ", " << weights[3] <<
341  "})";
342  return os;
343 }
344 
345 /** Formatted output of the BoundingBoxTransformInfo type.
346  *
347  * @param[in] bbox_info Type to output.
348  *
349  * @return Formatted string.
350  */
351 inline std::string to_string(const BoundingBoxTransformInfo &bbox_info)
352 {
353  std::stringstream str;
354  str << bbox_info;
355  return str.str();
356 }
357 
358 /** Formatted output of the ComputeAnchorsInfo type.
359  *
360  * @param[out] os Output stream.
361  * @param[in] anchors_info Type to output.
362  *
363  * @return Modified output stream.
364  */
365 inline ::std::ostream &operator<<(::std::ostream &os, const ComputeAnchorsInfo &anchors_info)
366 {
367  os << "(" << anchors_info.feat_width() << "x" << anchors_info.feat_height() << ")~" << anchors_info.spatial_scale();
368  return os;
369 }
370 
371 /** Formatted output of the ComputeAnchorsInfo type.
372  *
373  * @param[in] anchors_info Type to output.
374  *
375  * @return Formatted string.
376  */
377 inline std::string to_string(const ComputeAnchorsInfo &anchors_info)
378 {
379  std::stringstream str;
380  str << anchors_info;
381  return str.str();
382 }
383 
384 /** Formatted output of the GenerateProposalsInfo type.
385  *
386  * @param[out] os Output stream.
387  * @param[in] proposals_info Type to output.
388  *
389  * @return Modified output stream.
390  */
391 inline ::std::ostream &operator<<(::std::ostream &os, const GenerateProposalsInfo &proposals_info)
392 {
393  os << "(" << proposals_info.im_width() << "x" << proposals_info.im_height() << ")~" << proposals_info.im_scale();
394  return os;
395 }
396 
397 /** Formatted output of the GenerateProposalsInfo type.
398  *
399  * @param[in] proposals_info Type to output.
400  *
401  * @return Formatted string.
402  */
403 inline std::string to_string(const GenerateProposalsInfo &proposals_info)
404 {
405  std::stringstream str;
406  str << proposals_info;
407  return str.str();
408 }
409 
410 /** Formatted output of the QuantizationInfo type.
411  *
412  * @param[out] os Output stream.
413  * @param[in] qinfo Type to output.
414  *
415  * @return Modified output stream.
416  */
417 inline ::std::ostream &operator<<(::std::ostream &os, const QuantizationInfo &qinfo)
418 {
419  const UniformQuantizationInfo uqinfo = qinfo.uniform();
420  os << "Scale:" << uqinfo.scale << "~";
421  os << "Offset:" << uqinfo.offset;
422  return os;
423 }
424 
425 /** Formatted output of the QuantizationInfo type.
426  *
427  * @param[in] quantization_info Type to output.
428  *
429  * @return Formatted string.
430  */
431 inline std::string to_string(const QuantizationInfo &quantization_info)
432 {
433  std::stringstream str;
434  str << quantization_info;
435  return str.str();
436 }
437 
438 /** Formatted output of the activation function type.
439  *
440  * @param[out] os Output stream.
441  * @param[in] act_function Type to output.
442  *
443  * @return Modified output stream.
444  */
445 inline ::std::ostream &operator<<(::std::ostream &os, const ActivationLayerInfo::ActivationFunction &act_function)
446 {
447  switch(act_function)
448  {
450  os << "ABS";
451  break;
453  os << "LINEAR";
454  break;
456  os << "LOGISTIC";
457  break;
459  os << "RELU";
460  break;
462  os << "BOUNDED_RELU";
463  break;
465  os << "LEAKY_RELU";
466  break;
468  os << "SOFT_RELU";
469  break;
471  os << "SQRT";
472  break;
474  os << "LU_BOUNDED_RELU";
475  break;
477  os << "ELU";
478  break;
480  os << "SQUARE";
481  break;
483  os << "TANH";
484  break;
486  os << "IDENTITY";
487  break;
489  os << "HARD_SWISH";
490  break;
491 
492  default:
493  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
494  }
495 
496  return os;
497 }
498 
499 /** Formatted output of the activation function info type.
500  *
501  * @param[in] info Type to output.
502  *
503  * @return Formatted string.
504  */
506 {
507  std::stringstream str;
508  if(info.enabled())
509  {
510  str << info.activation();
511  }
512  return str.str();
513 }
514 
515 /** Formatted output of the activation function type.
516  *
517  * @param[in] function Type to output.
518  *
519  * @return Formatted string.
520  */
522 {
523  std::stringstream str;
524  str << function;
525  return str.str();
526 }
527 
528 /** Formatted output of the NormType type.
529  *
530  * @param[out] os Output stream.
531  * @param[in] norm_type Type to output.
532  *
533  * @return Modified output stream.
534  */
535 inline ::std::ostream &operator<<(::std::ostream &os, const NormType &norm_type)
536 {
537  switch(norm_type)
538  {
539  case NormType::CROSS_MAP:
540  os << "CROSS_MAP";
541  break;
542  case NormType::IN_MAP_1D:
543  os << "IN_MAP_1D";
544  break;
545  case NormType::IN_MAP_2D:
546  os << "IN_MAP_2D";
547  break;
548  default:
549  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
550  }
551 
552  return os;
553 }
554 
555 /** Formatted output of @ref NormalizationLayerInfo.
556  *
557  * @param[in] info Type to output.
558  *
559  * @return Formatted string.
560  */
562 {
563  std::stringstream str;
564  str << info.type() << ":NormSize=" << info.norm_size();
565  return str.str();
566 }
567 
568 /** Formatted output of @ref NormalizationLayerInfo.
569  *
570  * @param[out] os Output stream.
571  * @param[in] info Type to output.
572  *
573  * @return Modified output stream.
574  */
575 inline ::std::ostream &operator<<(::std::ostream &os, const NormalizationLayerInfo &info)
576 {
577  os << info.type() << ":NormSize=" << info.norm_size();
578  return os;
579 }
580 
581 /** Formatted output of the PoolingType type.
582  *
583  * @param[out] os Output stream.
584  * @param[in] pool_type Type to output.
585  *
586  * @return Modified output stream.
587  */
588 inline ::std::ostream &operator<<(::std::ostream &os, const PoolingType &pool_type)
589 {
590  switch(pool_type)
591  {
592  case PoolingType::AVG:
593  os << "AVG";
594  break;
595  case PoolingType::MAX:
596  os << "MAX";
597  break;
598  case PoolingType::L2:
599  os << "L2";
600  break;
601  default:
602  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
603  }
604 
605  return os;
606 }
607 
608 /** Formatted output of @ref PoolingLayerInfo.
609  *
610  * @param[out] os Output stream.
611  * @param[in] info Type to output.
612  *
613  * @return Modified output stream.
614  */
615 inline ::std::ostream &operator<<(::std::ostream &os, const PoolingLayerInfo &info)
616 {
617  os << info.pool_type;
618 
619  return os;
620 }
621 
622 /** Formatted output of @ref RoundingPolicy.
623  *
624  * @param[in] rounding_policy Type to output.
625  *
626  * @return Formatted string.
627  */
628 inline std::string to_string(const RoundingPolicy &rounding_policy)
629 {
630  std::stringstream str;
631  str << rounding_policy;
632  return str.str();
633 }
634 
635 /** [Print DataLayout type] **/
636 /** Formatted output of the DataLayout type.
637  *
638  * @param[out] os Output stream.
639  * @param[in] data_layout Type to output.
640  *
641  * @return Modified output stream.
642  */
643 inline ::std::ostream &operator<<(::std::ostream &os, const DataLayout &data_layout)
644 {
645  switch(data_layout)
646  {
647  case DataLayout::UNKNOWN:
648  os << "UNKNOWN";
649  break;
650  case DataLayout::NHWC:
651  os << "NHWC";
652  break;
653  case DataLayout::NCHW:
654  os << "NCHW";
655  break;
656  default:
657  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
658  }
659 
660  return os;
661 }
662 
663 /** Formatted output of the DataLayout type.
664  *
665  * @param[in] data_layout Type to output.
666  *
667  * @return Formatted string.
668  */
670 {
671  std::stringstream str;
672  str << data_layout;
673  return str.str();
674 }
675 /** [Print DataLayout type] **/
676 
677 /** Formatted output of the DataLayoutDimension type.
678  *
679  * @param[out] os Output stream.
680  * @param[in] data_layout_dim Data layout dimension to print.
681  *
682  * @return Modified output stream.
683  */
684 inline ::std::ostream &operator<<(::std::ostream &os, const DataLayoutDimension &data_layout_dim)
685 {
686  switch(data_layout_dim)
687  {
689  os << "WIDTH";
690  break;
692  os << "HEIGHT";
693  break;
695  os << "CHANNEL";
696  break;
698  os << "BATCHES";
699  break;
700  default:
701  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
702  }
703  return os;
704 }
705 
706 /** Formatted output of the DataType type.
707  *
708  * @param[out] os Output stream.
709  * @param[in] data_type Type to output.
710  *
711  * @return Modified output stream.
712  */
713 inline ::std::ostream &operator<<(::std::ostream &os, const DataType &data_type)
714 {
715  switch(data_type)
716  {
717  case DataType::UNKNOWN:
718  os << "UNKNOWN";
719  break;
720  case DataType::U8:
721  os << "U8";
722  break;
723  case DataType::QSYMM8:
724  os << "QSYMM8";
725  break;
726  case DataType::QASYMM8:
727  os << "QASYMM8";
728  break;
730  os << "QASYMM8_SIGNED";
731  break;
733  os << "QSYMM8_PER_CHANNEL";
734  break;
735  case DataType::S8:
736  os << "S8";
737  break;
738  case DataType::U16:
739  os << "U16";
740  break;
741  case DataType::S16:
742  os << "S16";
743  break;
744  case DataType::QSYMM16:
745  os << "QSYMM16";
746  break;
747  case DataType::QASYMM16:
748  os << "QASYMM16";
749  break;
750  case DataType::U32:
751  os << "U32";
752  break;
753  case DataType::S32:
754  os << "S32";
755  break;
756  case DataType::U64:
757  os << "U64";
758  break;
759  case DataType::S64:
760  os << "S64";
761  break;
762  case DataType::BFLOAT16:
763  os << "BFLOAT16";
764  break;
765  case DataType::F16:
766  os << "F16";
767  break;
768  case DataType::F32:
769  os << "F32";
770  break;
771  case DataType::F64:
772  os << "F64";
773  break;
774  case DataType::SIZET:
775  os << "SIZET";
776  break;
777  default:
778  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
779  }
780 
781  return os;
782 }
783 
784 /** Formatted output of the DataType type.
785  *
786  * @param[in] data_type Type to output.
787  *
788  * @return Formatted string.
789  */
790 inline std::string to_string(const arm_compute::DataType &data_type)
791 {
792  std::stringstream str;
793  str << data_type;
794  return str.str();
795 }
796 
797 /** Formatted output of the Format type.
798  *
799  * @param[out] os Output stream.
800  * @param[in] format Type to output.
801  *
802  * @return Modified output stream.
803  */
804 inline ::std::ostream &operator<<(::std::ostream &os, const Format &format)
805 {
806  switch(format)
807  {
808  case Format::UNKNOWN:
809  os << "UNKNOWN";
810  break;
811  case Format::U8:
812  os << "U8";
813  break;
814  case Format::S16:
815  os << "S16";
816  break;
817  case Format::U16:
818  os << "U16";
819  break;
820  case Format::S32:
821  os << "S32";
822  break;
823  case Format::U32:
824  os << "U32";
825  break;
826  case Format::F16:
827  os << "F16";
828  break;
829  case Format::F32:
830  os << "F32";
831  break;
832  case Format::UV88:
833  os << "UV88";
834  break;
835  case Format::RGB888:
836  os << "RGB888";
837  break;
838  case Format::RGBA8888:
839  os << "RGBA8888";
840  break;
841  case Format::YUV444:
842  os << "YUV444";
843  break;
844  case Format::YUYV422:
845  os << "YUYV422";
846  break;
847  case Format::NV12:
848  os << "NV12";
849  break;
850  case Format::NV21:
851  os << "NV21";
852  break;
853  case Format::IYUV:
854  os << "IYUV";
855  break;
856  case Format::UYVY422:
857  os << "UYVY422";
858  break;
859  default:
860  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
861  }
862 
863  return os;
864 }
865 
866 /** Formatted output of the Format type.
867  *
868  * @param[in] format Type to output.
869  *
870  * @return Formatted string.
871  */
872 inline std::string to_string(const Format &format)
873 {
874  std::stringstream str;
875  str << format;
876  return str.str();
877 }
878 
879 /** Formatted output of the Channel type.
880  *
881  * @param[out] os Output stream.
882  * @param[in] channel Type to output.
883  *
884  * @return Modified output stream.
885  */
886 inline ::std::ostream &operator<<(::std::ostream &os, const Channel &channel)
887 {
888  switch(channel)
889  {
890  case Channel::UNKNOWN:
891  os << "UNKNOWN";
892  break;
893  case Channel::C0:
894  os << "C0";
895  break;
896  case Channel::C1:
897  os << "C1";
898  break;
899  case Channel::C2:
900  os << "C2";
901  break;
902  case Channel::C3:
903  os << "C3";
904  break;
905  case Channel::R:
906  os << "R";
907  break;
908  case Channel::G:
909  os << "G";
910  break;
911  case Channel::B:
912  os << "B";
913  break;
914  case Channel::A:
915  os << "A";
916  break;
917  case Channel::Y:
918  os << "Y";
919  break;
920  case Channel::U:
921  os << "U";
922  break;
923  case Channel::V:
924  os << "V";
925  break;
926  default:
927  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
928  }
929 
930  return os;
931 }
932 
933 /** Formatted output of the Channel type.
934  *
935  * @param[in] channel Type to output.
936  *
937  * @return Formatted string.
938  */
939 inline std::string to_string(const Channel &channel)
940 {
941  std::stringstream str;
942  str << channel;
943  return str.str();
944 }
945 
946 /** Formatted output of the BorderMode type.
947  *
948  * @param[out] os Output stream.
949  * @param[in] mode Type to output.
950  *
951  * @return Modified output stream.
952  */
953 inline ::std::ostream &operator<<(::std::ostream &os, const BorderMode &mode)
954 {
955  switch(mode)
956  {
958  os << "UNDEFINED";
959  break;
961  os << "CONSTANT";
962  break;
964  os << "REPLICATE";
965  break;
966  default:
967  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
968  }
969 
970  return os;
971 }
972 
973 /** Formatted output of the BorderSize type.
974  *
975  * @param[out] os Output stream.
976  * @param[in] border Type to output.
977  *
978  * @return Modified output stream.
979  */
980 inline ::std::ostream &operator<<(::std::ostream &os, const BorderSize &border)
981 {
982  os << border.top << ","
983  << border.right << ","
984  << border.bottom << ","
985  << border.left;
986 
987  return os;
988 }
989 
990 /** Formatted output of the PaddingList type.
991  *
992  * @param[out] os Output stream.
993  * @param[in] padding Type to output.
994  *
995  * @return Modified output stream.
996  */
997 inline ::std::ostream &operator<<(::std::ostream &os, const PaddingList &padding)
998 {
999  os << "{";
1000  for(auto const &p : padding)
1001  {
1002  os << "{" << p.first << "," << p.second << "}";
1003  }
1004  os << "}";
1005  return os;
1006 }
1007 
1008 /** Formatted output of the Multiples type.
1009  *
1010  * @param[out] os Output stream.
1011  * @param[in] multiples Type to output.
1012  *
1013  * @return Modified output stream.
1014  */
1015 inline ::std::ostream &operator<<(::std::ostream &os, const Multiples &multiples)
1016 {
1017  os << "(";
1018  for(size_t i = 0; i < multiples.size() - 1; i++)
1019  {
1020  os << multiples[i] << ", ";
1021  }
1022  os << multiples.back() << ")";
1023  return os;
1024 }
1025 
1026 /** Formatted output of the InterpolationPolicy type.
1027  *
1028  * @param[out] os Output stream.
1029  * @param[in] policy Type to output.
1030  *
1031  * @return Modified output stream.
1032  */
1033 inline ::std::ostream &operator<<(::std::ostream &os, const InterpolationPolicy &policy)
1034 {
1035  switch(policy)
1036  {
1038  os << "NEAREST_NEIGHBOR";
1039  break;
1041  os << "BILINEAR";
1042  break;
1044  os << "AREA";
1045  break;
1046  default:
1047  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1048  }
1049 
1050  return os;
1051 }
1052 
1053 /** Formatted output of the SamplingPolicy type.
1054  *
1055  * @param[out] os Output stream.
1056  * @param[in] policy Type to output.
1057  *
1058  * @return Modified output stream.
1059  */
1060 inline ::std::ostream &operator<<(::std::ostream &os, const SamplingPolicy &policy)
1061 {
1062  switch(policy)
1063  {
1065  os << "CENTER";
1066  break;
1068  os << "TOP_LEFT";
1069  break;
1070  default:
1071  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1072  }
1073 
1074  return os;
1075 }
1076 
1077 /** Formatted output of the TensorInfo type.
1078  *
1079  * @param[out] os Output stream.
1080  * @param[in] info Type to output.
1081  *
1082  * @return Modified output stream.
1083  */
1084 inline ::std::ostream &operator<<(::std::ostream &os, const TensorInfo &info)
1085 {
1086  os << "{Shape=" << info.tensor_shape() << ","
1087  << "Type=" << info.data_type() << ","
1088  << "Channels=" << info.num_channels() << "}";
1089  return os;
1090 }
1091 /** Formatted output of the TensorInfo type.
1092  *
1093  * @param[in] info Type to output.
1094  *
1095  * @return Formatted string.
1096  */
1097 inline std::string to_string(const TensorInfo &info)
1098 {
1099  std::stringstream str;
1100  str << info;
1101  return str.str();
1102 }
1103 
1104 /** Formatted output of the Dimensions type.
1105  *
1106  * @param[in] dimensions Type to output.
1107  *
1108  * @return Formatted string.
1109  */
1110 template <typename T>
1111 inline std::string to_string(const Dimensions<T> &dimensions)
1112 {
1113  std::stringstream str;
1114  str << dimensions;
1115  return str.str();
1116 }
1117 
1118 /** Formatted output of the Strides type.
1119  *
1120  * @param[in] stride Type to output.
1121  *
1122  * @return Formatted string.
1123  */
1124 inline std::string to_string(const Strides &stride)
1125 {
1126  std::stringstream str;
1127  str << stride;
1128  return str.str();
1129 }
1130 
1131 /** Formatted output of the TensorShape type.
1132  *
1133  * @param[in] shape Type to output.
1134  *
1135  * @return Formatted string.
1136  */
1137 inline std::string to_string(const TensorShape &shape)
1138 {
1139  std::stringstream str;
1140  str << shape;
1141  return str.str();
1142 }
1143 
1144 /** Formatted output of the Coordinates type.
1145  *
1146  * @param[in] coord Type to output.
1147  *
1148  * @return Formatted string.
1149  */
1150 inline std::string to_string(const Coordinates &coord)
1151 {
1152  std::stringstream str;
1153  str << coord;
1154  return str.str();
1155 }
1156 
1157 /** Formatted output of the GEMMReshapeInfo type.
1158  *
1159  * @param[out] os Output stream.
1160  * @param[in] info Type to output.
1161  *
1162  * @return Modified output stream.
1163  */
1164 inline ::std::ostream &operator<<(::std::ostream &os, const GEMMReshapeInfo &info)
1165 {
1166  os << "{m=" << info.m() << ",";
1167  os << "n=" << info.n() << ",";
1168  os << "k=" << info.k() << ",";
1169  os << "mult_transpose1xW_width=" << info.mult_transpose1xW_width() << ",";
1170  os << "mult_interleave4x4_height=" << info.mult_interleave4x4_height();
1171  os << "}";
1172 
1173  return os;
1174 }
1175 
1176 /** Formatted output of the GEMMInfo type.
1177  *
1178  * @param[out] os Output stream.
1179  * @param[in] info Type to output.
1180  *
1181  * @return Modified output stream.
1182  */
1183 inline ::std::ostream &operator<<(::std::ostream &os, const GEMMInfo &info)
1184 {
1185  os << "{is_a_reshaped=" << info.is_a_reshaped() << ",";
1186  os << "is_b_reshaped=" << info.is_b_reshaped() << ",";
1187  os << "reshape_b_only_on_first_run=" << info.reshape_b_only_on_first_run() << ",";
1188  os << "depth_output_gemm3d=" << info.depth_output_gemm3d() << ",";
1189  os << "reinterpret_input_as_3d=" << info.reinterpret_input_as_3d() << ",";
1190  os << "retain_internal_weights=" << info.retain_internal_weights() << ",";
1191  os << "fp_mixed_precision=" << info.fp_mixed_precision() << ",";
1192  os << "broadcast_bias=" << info.broadcast_bias() << ",";
1193  os << "pretranpose_B=" << info.pretranpose_B() << ",";
1194 
1195  return os;
1196 }
1197 
1198 /** Formatted output of the Window::Dimension type.
1199  *
1200  * @param[out] os Output stream.
1201  * @param[in] dim Type to output.
1202  *
1203  * @return Modified output stream.
1204  */
1205 inline ::std::ostream &operator<<(::std::ostream &os, const Window::Dimension &dim)
1206 {
1207  os << "{start=" << dim.start() << ", end=" << dim.end() << ", step=" << dim.step() << "}";
1208 
1209  return os;
1210 }
1211 /** Formatted output of the Window type.
1212  *
1213  * @param[out] os Output stream.
1214  * @param[in] win Type to output.
1215  *
1216  * @return Modified output stream.
1217  */
1218 inline ::std::ostream &operator<<(::std::ostream &os, const Window &win)
1219 {
1220  os << "{";
1221  for(unsigned int i = 0; i < Coordinates::num_max_dimensions; i++)
1222  {
1223  if(i > 0)
1224  {
1225  os << ", ";
1226  }
1227  os << win[i];
1228  }
1229  os << "}";
1230 
1231  return os;
1232 }
1233 
1234 /** Formatted output of the WeightsInfo type.
1235  *
1236  * @param[in] info Type to output.
1237  *
1238  * @return Formatted string.
1239  */
1240 inline std::string to_string(const WeightsInfo &info)
1241 {
1242  std::stringstream str;
1243  str << info;
1244  return str.str();
1245 }
1246 
1247 /** Formatted output of the GEMMReshapeInfo type.
1248  *
1249  * @param[in] info Type to output.
1250  *
1251  * @return Formatted string.
1252  */
1253 inline std::string to_string(const GEMMReshapeInfo &info)
1254 {
1255  std::stringstream str;
1256  str << info;
1257  return str.str();
1258 }
1259 
1260 /** Formatted output of the GEMMInfo type.
1261  *
1262  * @param[in] info Type to output.
1263  *
1264  * @return Formatted string.
1265  */
1266 inline std::string to_string(const GEMMInfo &info)
1267 {
1268  std::stringstream str;
1269  str << info;
1270  return str.str();
1271 }
1272 
1273 /** Formatted output of the Window::Dimension type.
1274  *
1275  * @param[in] dim Type to output.
1276  *
1277  * @return Formatted string.
1278  */
1279 inline std::string to_string(const Window::Dimension &dim)
1280 {
1281  std::stringstream str;
1282  str << dim;
1283  return str.str();
1284 }
1285 /** Formatted output of the Window type.
1286  *
1287  * @param[in] win Type to output.
1288  *
1289  * @return Formatted string.
1290  */
1291 inline std::string to_string(const Window &win)
1292 {
1293  std::stringstream str;
1294  str << win;
1295  return str.str();
1296 }
1297 
1298 /** Formatted output of the Rectangle type.
1299  *
1300  * @param[out] os Output stream.
1301  * @param[in] rect Type to output.
1302  *
1303  * @return Modified output stream.
1304  */
1305 inline ::std::ostream &operator<<(::std::ostream &os, const Rectangle &rect)
1306 {
1307  os << rect.width << "x" << rect.height;
1308  os << "+" << rect.x << "+" << rect.y;
1309 
1310  return os;
1311 }
1312 
1313 /** Formatted output of the PaddingMode type.
1314  *
1315  * @param[out] os Output stream.
1316  * @param[in] mode Type to output.
1317  *
1318  * @return Modified output stream.
1319  */
1320 inline ::std::ostream &operator<<(::std::ostream &os, const PaddingMode &mode)
1321 {
1322  switch(mode)
1323  {
1324  case PaddingMode::CONSTANT:
1325  os << "CONSTANT";
1326  break;
1327  case PaddingMode::REFLECT:
1328  os << "REFLECT";
1329  break;
1331  os << "SYMMETRIC";
1332  break;
1333  default:
1334  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1335  }
1336 
1337  return os;
1338 }
1339 
1340 /** Formatted output of the PaddingMode type.
1341  *
1342  * @param[in] mode Type to output.
1343  *
1344  * @return Formatted string.
1345  */
1346 inline std::string to_string(const PaddingMode &mode)
1347 {
1348  std::stringstream str;
1349  str << mode;
1350  return str.str();
1351 }
1352 
1353 /** Formatted output of the PadStrideInfo type.
1354  *
1355  * @param[out] os Output stream.
1356  * @param[in] pad_stride_info Type to output.
1357  *
1358  * @return Modified output stream.
1359  */
1360 inline ::std::ostream &operator<<(::std::ostream &os, const PadStrideInfo &pad_stride_info)
1361 {
1362  os << pad_stride_info.stride().first << "," << pad_stride_info.stride().second;
1363  os << ";";
1364  os << pad_stride_info.pad_left() << "," << pad_stride_info.pad_right() << ","
1365  << pad_stride_info.pad_top() << "," << pad_stride_info.pad_bottom();
1366 
1367  return os;
1368 }
1369 
1370 /** Formatted output of the PadStrideInfo type.
1371  *
1372  * @param[in] pad_stride_info Type to output.
1373  *
1374  * @return Formatted string.
1375  */
1376 inline std::string to_string(const PadStrideInfo &pad_stride_info)
1377 {
1378  std::stringstream str;
1379  str << pad_stride_info;
1380  return str.str();
1381 }
1382 
1383 /** Formatted output of the BorderMode type.
1384  *
1385  * @param[in] mode Type to output.
1386  *
1387  * @return Formatted string.
1388  */
1389 inline std::string to_string(const BorderMode &mode)
1390 {
1391  std::stringstream str;
1392  str << mode;
1393  return str.str();
1394 }
1395 
1396 /** Formatted output of the BorderSize type.
1397  *
1398  * @param[in] border Type to output.
1399  *
1400  * @return Formatted string.
1401  */
1402 inline std::string to_string(const BorderSize &border)
1403 {
1404  std::stringstream str;
1405  str << border;
1406  return str.str();
1407 }
1408 
1409 /** Formatted output of the PaddingList type.
1410  *
1411  * @param[in] padding Type to output.
1412  *
1413  * @return Formatted string.
1414  */
1415 inline std::string to_string(const PaddingList &padding)
1416 {
1417  std::stringstream str;
1418  str << padding;
1419  return str.str();
1420 }
1421 
1422 /** Formatted output of the Multiples type.
1423  *
1424  * @param[in] multiples Type to output.
1425  *
1426  * @return Formatted string.
1427  */
1428 inline std::string to_string(const Multiples &multiples)
1429 {
1430  std::stringstream str;
1431  str << multiples;
1432  return str.str();
1433 }
1434 
1435 /** Formatted output of the InterpolationPolicy type.
1436  *
1437  * @param[in] policy Type to output.
1438  *
1439  * @return Formatted string.
1440  */
1441 inline std::string to_string(const InterpolationPolicy &policy)
1442 {
1443  std::stringstream str;
1444  str << policy;
1445  return str.str();
1446 }
1447 
1448 /** Formatted output of the SamplingPolicy type.
1449  *
1450  * @param[in] policy Type to output.
1451  *
1452  * @return Formatted string.
1453  */
1454 inline std::string to_string(const SamplingPolicy &policy)
1455 {
1456  std::stringstream str;
1457  str << policy;
1458  return str.str();
1459 }
1460 
1461 /** Formatted output of the ConvertPolicy type.
1462  *
1463  * @param[out] os Output stream.
1464  * @param[in] policy Type to output.
1465  *
1466  * @return Modified output stream.
1467  */
1468 inline ::std::ostream &operator<<(::std::ostream &os, const ConvertPolicy &policy)
1469 {
1470  switch(policy)
1471  {
1472  case ConvertPolicy::WRAP:
1473  os << "WRAP";
1474  break;
1476  os << "SATURATE";
1477  break;
1478  default:
1479  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1480  }
1481 
1482  return os;
1483 }
1484 
1485 inline std::string to_string(const ConvertPolicy &policy)
1486 {
1487  std::stringstream str;
1488  str << policy;
1489  return str.str();
1490 }
1491 
1492 /** Formatted output of the ArithmeticOperation type.
1493  *
1494  * @param[out] os Output stream.
1495  * @param[in] op Operation to output.
1496  *
1497  * @return Modified output stream.
1498  */
1499 inline ::std::ostream &operator<<(::std::ostream &os, const ArithmeticOperation &op)
1500 {
1501  switch(op)
1502  {
1504  os << "ADD";
1505  break;
1507  os << "SUB";
1508  break;
1510  os << "DIV";
1511  break;
1513  os << "MAX";
1514  break;
1516  os << "MIN";
1517  break;
1519  os << "SQUARED_DIFF";
1520  break;
1522  os << "POWER";
1523  break;
1524  default:
1525  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1526  }
1527 
1528  return os;
1529 }
1530 
1531 /** Formatted output of the Arithmetic Operation
1532  *
1533  * @param[in] op Type to output.
1534  *
1535  * @return Formatted string.
1536  */
1537 inline std::string to_string(const ArithmeticOperation &op)
1538 {
1539  std::stringstream str;
1540  str << op;
1541  return str.str();
1542 }
1543 
1544 /** Formatted output of the Reduction Operations.
1545  *
1546  * @param[out] os Output stream.
1547  * @param[in] op Type to output.
1548  *
1549  * @return Modified output stream.
1550  */
1551 inline ::std::ostream &operator<<(::std::ostream &os, const ReductionOperation &op)
1552 {
1553  switch(op)
1554  {
1556  os << "SUM";
1557  break;
1559  os << "SUM_SQUARE";
1560  break;
1562  os << "MEAN_SUM";
1563  break;
1565  os << "ARG_IDX_MAX";
1566  break;
1568  os << "ARG_IDX_MIN";
1569  break;
1571  os << "PROD";
1572  break;
1574  os << "MIN";
1575  break;
1577  os << "MAX";
1578  break;
1579  default:
1580  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1581  }
1582 
1583  return os;
1584 }
1585 
1586 /** Formatted output of the Reduction Operations.
1587  *
1588  * @param[in] op Type to output.
1589  *
1590  * @return Formatted string.
1591  */
1592 inline std::string to_string(const ReductionOperation &op)
1593 {
1594  std::stringstream str;
1595  str << op;
1596  return str.str();
1597 }
1598 
1599 /** Formatted output of the Comparison Operations.
1600  *
1601  * @param[out] os Output stream.
1602  * @param[in] op Type to output.
1603  *
1604  * @return Modified output stream.
1605  */
1606 inline ::std::ostream &operator<<(::std::ostream &os, const ComparisonOperation &op)
1607 {
1608  switch(op)
1609  {
1611  os << "Equal";
1612  break;
1614  os << "NotEqual";
1615  break;
1617  os << "Greater";
1618  break;
1620  os << "GreaterEqual";
1621  break;
1623  os << "Less";
1624  break;
1626  os << "LessEqual";
1627  break;
1628  default:
1629  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1630  }
1631 
1632  return os;
1633 }
1634 
1635 /** Formatted output of the Elementwise unary Operations.
1636  *
1637  * @param[out] os Output stream.
1638  * @param[in] op Type to output.
1639  *
1640  * @return Modified output stream.
1641  */
1642 inline ::std::ostream &operator<<(::std::ostream &os, const ElementWiseUnary &op)
1643 {
1644  switch(op)
1645  {
1647  os << "RSQRT";
1648  break;
1649  case ElementWiseUnary::EXP:
1650  os << "EXP";
1651  break;
1652  case ElementWiseUnary::NEG:
1653  os << "NEG";
1654  break;
1655  case ElementWiseUnary::LOG:
1656  os << "LOG";
1657  break;
1659  os << "ROUND";
1660  break;
1661  default:
1662  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1663  }
1664 
1665  return os;
1666 }
1667 
1668 /** Formatted output of the Comparison Operations.
1669  *
1670  * @param[in] op Type to output.
1671  *
1672  * @return Formatted string.
1673  */
1674 inline std::string to_string(const ComparisonOperation &op)
1675 {
1676  std::stringstream str;
1677  str << op;
1678  return str.str();
1679 }
1680 
1681 /** Formatted output of the Elementwise unary Operations.
1682  *
1683  * @param[in] op Type to output.
1684  *
1685  * @return Formatted string.
1686  */
1687 inline std::string to_string(const ElementWiseUnary &op)
1688 {
1689  std::stringstream str;
1690  str << op;
1691  return str.str();
1692 }
1693 
1694 /** Formatted output of the Norm Type.
1695  *
1696  * @param[in] type Type to output.
1697  *
1698  * @return Formatted string.
1699  */
1700 inline std::string to_string(const NormType &type)
1701 {
1702  std::stringstream str;
1703  str << type;
1704  return str.str();
1705 }
1706 
1707 /** Formatted output of the Pooling Type.
1708  *
1709  * @param[in] type Type to output.
1710  *
1711  * @return Formatted string.
1712  */
1713 inline std::string to_string(const PoolingType &type)
1714 {
1715  std::stringstream str;
1716  str << type;
1717  return str.str();
1718 }
1719 
1720 /** Formatted output of the Pooling Layer Info.
1721  *
1722  * @param[in] info Type to output.
1723  *
1724  * @return Formatted string.
1725  */
1726 inline std::string to_string(const PoolingLayerInfo &info)
1727 {
1728  std::stringstream str;
1729  str << "{Type=" << info.pool_type << ","
1730  << "DataLayout=" << info.data_layout << ","
1731  << "IsGlobalPooling=" << info.is_global_pooling;
1732  if(!info.is_global_pooling)
1733  {
1734  str << ","
1735  << "PoolSize=" << info.pool_size.width << "," << info.pool_size.height << ","
1736  << "PadStride=" << info.pad_stride_info;
1737  }
1738  str << "}";
1739  return str.str();
1740 }
1741 
1742 /** Formatted output of the PriorBoxLayerInfo.
1743  *
1744  * @param[in] info Type to output.
1745  *
1746  * @return Formatted string.
1747  */
1748 inline std::string to_string(const PriorBoxLayerInfo &info)
1749 {
1750  std::stringstream str;
1751  str << "{";
1752  str << "Clip:" << info.clip()
1753  << "Flip:" << info.flip()
1754  << "StepX:" << info.steps()[0]
1755  << "StepY:" << info.steps()[1]
1756  << "MinSizes:" << info.min_sizes().size()
1757  << "MaxSizes:" << info.max_sizes().size()
1758  << "ImgSizeX:" << info.img_size().x
1759  << "ImgSizeY:" << info.img_size().y
1760  << "Offset:" << info.offset()
1761  << "Variances:" << info.variances().size();
1762  str << "}";
1763  return str.str();
1764 }
1765 
1766 /** Formatted output of the KeyPoint type.
1767  *
1768  * @param[out] os Output stream
1769  * @param[in] point Type to output.
1770  *
1771  * @return Modified output stream.
1772  */
1773 inline ::std::ostream &operator<<(::std::ostream &os, const KeyPoint &point)
1774 {
1775  os << "{x=" << point.x << ","
1776  << "y=" << point.y << ","
1777  << "strength=" << point.strength << ","
1778  << "scale=" << point.scale << ","
1779  << "orientation=" << point.orientation << ","
1780  << "tracking_status=" << point.tracking_status << ","
1781  << "error=" << point.error << "}";
1782 
1783  return os;
1784 }
1785 
1786 /** Formatted output of the PhaseType type.
1787  *
1788  * @param[out] os Output stream
1789  * @param[in] phase_type Type to output.
1790  *
1791  * @return Modified output stream.
1792  */
1793 inline ::std::ostream &operator<<(::std::ostream &os, const PhaseType &phase_type)
1794 {
1795  switch(phase_type)
1796  {
1797  case PhaseType::SIGNED:
1798  os << "SIGNED";
1799  break;
1800  case PhaseType::UNSIGNED:
1801  os << "UNSIGNED";
1802  break;
1803  default:
1804  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1805  }
1806 
1807  return os;
1808 }
1809 
1810 /** Formatted output of the PhaseType type.
1811  *
1812  * @param[in] type Type to output.
1813  *
1814  * @return Formatted string.
1815  */
1816 inline std::string to_string(const arm_compute::PhaseType &type)
1817 {
1818  std::stringstream str;
1819  str << type;
1820  return str.str();
1821 }
1822 
1823 /** Formatted output of the MagnitudeType type.
1824  *
1825  * @param[out] os Output stream
1826  * @param[in] magnitude_type Type to output.
1827  *
1828  * @return Modified output stream.
1829  */
1830 inline ::std::ostream &operator<<(::std::ostream &os, const MagnitudeType &magnitude_type)
1831 {
1832  switch(magnitude_type)
1833  {
1834  case MagnitudeType::L1NORM:
1835  os << "L1NORM";
1836  break;
1837  case MagnitudeType::L2NORM:
1838  os << "L2NORM";
1839  break;
1840  default:
1841  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1842  }
1843 
1844  return os;
1845 }
1846 
1847 /** Formatted output of the MagnitudeType type.
1848  *
1849  * @param[in] type Type to output.
1850  *
1851  * @return Formatted string.
1852  */
1853 inline std::string to_string(const arm_compute::MagnitudeType &type)
1854 {
1855  std::stringstream str;
1856  str << type;
1857  return str.str();
1858 }
1859 
1860 /** Formatted output of the HOGNormType type.
1861  *
1862  * @param[out] os Output stream
1863  * @param[in] norm_type Type to output
1864  *
1865  * @return Modified output stream.
1866  */
1867 inline ::std::ostream &operator<<(::std::ostream &os, const HOGNormType &norm_type)
1868 {
1869  switch(norm_type)
1870  {
1871  case HOGNormType::L1_NORM:
1872  os << "L1_NORM";
1873  break;
1874  case HOGNormType::L2_NORM:
1875  os << "L2_NORM";
1876  break;
1878  os << "L2HYS_NORM";
1879  break;
1880  default:
1881  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1882  }
1883 
1884  return os;
1885 }
1886 
1887 /** Formatted output of the HOGNormType type.
1888  *
1889  * @param[in] type Type to output
1890  *
1891  * @return Formatted string.
1892  */
1893 inline std::string to_string(const HOGNormType &type)
1894 {
1895  std::stringstream str;
1896  str << type;
1897  return str.str();
1898 }
1899 
1900 /** Formatted output of the Size2D type.
1901  *
1902  * @param[out] os Output stream
1903  * @param[in] size Type to output
1904  *
1905  * @return Modified output stream.
1906  */
1907 inline ::std::ostream &operator<<(::std::ostream &os, const Size2D &size)
1908 {
1909  os << size.width << "x" << size.height;
1910 
1911  return os;
1912 }
1913 
1914 /** Formatted output of the Size2D type.
1915  *
1916  * @param[in] type Type to output
1917  *
1918  * @return Formatted string.
1919  */
1920 inline std::string to_string(const Size2D &type)
1921 {
1922  std::stringstream str;
1923  str << type;
1924  return str.str();
1925 }
1926 
1927 /** Formatted output of the HOGInfo type.
1928  *
1929  * @param[out] os Output stream
1930  * @param[in] hog_info Type to output
1931  *
1932  * @return Modified output stream.
1933  */
1934 inline ::std::ostream &operator<<(::std::ostream &os, const HOGInfo &hog_info)
1935 {
1936  os << "{CellSize=" << hog_info.cell_size() << ","
1937  << "BlockSize=" << hog_info.block_size() << ","
1938  << "DetectionWindowSize=" << hog_info.detection_window_size() << ","
1939  << "BlockStride=" << hog_info.block_stride() << ","
1940  << "NumBins=" << hog_info.num_bins() << ","
1941  << "NormType=" << hog_info.normalization_type() << ","
1942  << "L2HystThreshold=" << hog_info.l2_hyst_threshold() << ","
1943  << "PhaseType=" << hog_info.phase_type() << "}";
1944 
1945  return os;
1946 }
1947 
1948 /** Formatted output of the HOGInfo type.
1949  *
1950  * @param[in] type Type to output
1951  *
1952  * @return Formatted string.
1953  */
1954 inline std::string to_string(const HOGInfo &type)
1955 {
1956  std::stringstream str;
1957  str << type;
1958  return str.str();
1959 }
1960 
1961 /** Formatted output of the ConvolutionMethod type.
1962  *
1963  * @param[out] os Output stream
1964  * @param[in] conv_method Type to output
1965  *
1966  * @return Modified output stream.
1967  */
1968 inline ::std::ostream &operator<<(::std::ostream &os, const ConvolutionMethod &conv_method)
1969 {
1970  switch(conv_method)
1971  {
1973  os << "GEMM";
1974  break;
1976  os << "DIRECT";
1977  break;
1979  os << "WINOGRAD";
1980  break;
1981  default:
1982  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1983  }
1984 
1985  return os;
1986 }
1987 
1988 /** Formatted output of the ConvolutionMethod type.
1989  *
1990  * @param[in] conv_method Type to output
1991  *
1992  * @return Formatted string.
1993  */
1994 inline std::string to_string(const ConvolutionMethod &conv_method)
1995 {
1996  std::stringstream str;
1997  str << conv_method;
1998  return str.str();
1999 }
2000 
2001 /** Formatted output of the GPUTarget type.
2002  *
2003  * @param[out] os Output stream
2004  * @param[in] gpu_target Type to output
2005  *
2006  * @return Modified output stream.
2007  */
2008 inline ::std::ostream &operator<<(::std::ostream &os, const GPUTarget &gpu_target)
2009 {
2010  switch(gpu_target)
2011  {
2013  os << "GPU_ARCH_MASK";
2014  break;
2015  case GPUTarget::MIDGARD:
2016  os << "MIDGARD";
2017  break;
2018  case GPUTarget::BIFROST:
2019  os << "BIFROST";
2020  break;
2021  case GPUTarget::VALHALL:
2022  os << "VALHALL";
2023  break;
2024  case GPUTarget::T600:
2025  os << "T600";
2026  break;
2027  case GPUTarget::T700:
2028  os << "T700";
2029  break;
2030  case GPUTarget::T800:
2031  os << "T800";
2032  break;
2033  case GPUTarget::G71:
2034  os << "G71";
2035  break;
2036  case GPUTarget::G72:
2037  os << "G72";
2038  break;
2039  case GPUTarget::G51:
2040  os << "G51";
2041  break;
2042  case GPUTarget::G51BIG:
2043  os << "G51BIG";
2044  break;
2045  case GPUTarget::G51LIT:
2046  os << "G51LIT";
2047  break;
2048  case GPUTarget::G76:
2049  os << "G76";
2050  break;
2051  case GPUTarget::G77:
2052  os << "G77";
2053  break;
2054  case GPUTarget::G78:
2055  os << "G78";
2056  break;
2057  case GPUTarget::TODX:
2058  os << "TODX";
2059  break;
2060  default:
2061  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2062  }
2063 
2064  return os;
2065 }
2066 
2067 /** Formatted output of the GPUTarget type.
2068  *
2069  * @param[in] gpu_target Type to output
2070  *
2071  * @return Formatted string.
2072  */
2073 inline std::string to_string(const GPUTarget &gpu_target)
2074 {
2075  std::stringstream str;
2076  str << gpu_target;
2077  return str.str();
2078 }
2079 
2080 /** Formatted output of the DetectionWindow type.
2081  *
2082  * @param[out] os Output stream
2083  * @param[in] detection_window Type to output
2084  *
2085  * @return Modified output stream.
2086  */
2087 inline ::std::ostream &operator<<(::std::ostream &os, const DetectionWindow &detection_window)
2088 {
2089  os << "{x=" << detection_window.x << ","
2090  << "y=" << detection_window.y << ","
2091  << "width=" << detection_window.width << ","
2092  << "height=" << detection_window.height << ","
2093  << "idx_class=" << detection_window.idx_class << ","
2094  << "score=" << detection_window.score << "}";
2095 
2096  return os;
2097 }
2098 
2099 /** Formatted output of the DetectionOutputLayerCodeType type.
2100  *
2101  * @param[out] os Output stream
2102  * @param[in] detection_code Type to output
2103  *
2104  * @return Modified output stream.
2105  */
2106 inline ::std::ostream &operator<<(::std::ostream &os, const DetectionOutputLayerCodeType &detection_code)
2107 {
2108  switch(detection_code)
2109  {
2111  os << "CENTER_SIZE";
2112  break;
2114  os << "CORNER";
2115  break;
2117  os << "CORNER_SIZE";
2118  break;
2120  os << "TF_CENTER";
2121  break;
2122  default:
2123  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2124  }
2125 
2126  return os;
2127 }
2128 /** Formatted output of the DetectionOutputLayerCodeType type.
2129  *
2130  * @param[in] detection_code Type to output
2131  *
2132  * @return Formatted string.
2133  */
2134 inline std::string to_string(const DetectionOutputLayerCodeType &detection_code)
2135 {
2136  std::stringstream str;
2137  str << detection_code;
2138  return str.str();
2139 }
2140 
2141 /** Formatted output of the DetectionOutputLayerInfo type.
2142  *
2143  * @param[out] os Output stream
2144  * @param[in] detection_info Type to output
2145  *
2146  * @return Modified output stream.
2147  */
2148 inline ::std::ostream &operator<<(::std::ostream &os, const DetectionOutputLayerInfo &detection_info)
2149 {
2150  os << "{Classes=" << detection_info.num_classes() << ","
2151  << "ShareLocation=" << detection_info.share_location() << ","
2152  << "CodeType=" << detection_info.code_type() << ","
2153  << "VarianceEncodedInTarget=" << detection_info.variance_encoded_in_target() << ","
2154  << "KeepTopK=" << detection_info.keep_top_k() << ","
2155  << "NMSThreshold=" << detection_info.nms_threshold() << ","
2156  << "Eta=" << detection_info.eta() << ","
2157  << "BackgroundLabelId=" << detection_info.background_label_id() << ","
2158  << "ConfidenceThreshold=" << detection_info.confidence_threshold() << ","
2159  << "TopK=" << detection_info.top_k() << ","
2160  << "NumLocClasses=" << detection_info.num_loc_classes()
2161  << "}";
2162 
2163  return os;
2164 }
2165 
2166 /** Formatted output of the DetectionOutputLayerInfo type.
2167  *
2168  * @param[in] detection_info Type to output
2169  *
2170  * @return Formatted string.
2171  */
2172 inline std::string to_string(const DetectionOutputLayerInfo &detection_info)
2173 {
2174  std::stringstream str;
2175  str << detection_info;
2176  return str.str();
2177 }
2178 /** Formatted output of the DetectionPostProcessLayerInfo type.
2179  *
2180  * @param[out] os Output stream
2181  * @param[in] detection_info Type to output
2182  *
2183  * @return Modified output stream.
2184  */
2185 inline ::std::ostream &operator<<(::std::ostream &os, const DetectionPostProcessLayerInfo &detection_info)
2186 {
2187  os << "{MaxDetections=" << detection_info.max_detections() << ","
2188  << "MaxClassesPerDetection=" << detection_info.max_classes_per_detection() << ","
2189  << "NmsScoreThreshold=" << detection_info.nms_score_threshold() << ","
2190  << "NmsIouThreshold=" << detection_info.iou_threshold() << ","
2191  << "NumClasses=" << detection_info.num_classes() << ","
2192  << "ScaleValue_y=" << detection_info.scale_value_y() << ","
2193  << "ScaleValue_x=" << detection_info.scale_value_x() << ","
2194  << "ScaleValue_h=" << detection_info.scale_value_h() << ","
2195  << "ScaleValue_w=" << detection_info.scale_value_w() << ","
2196  << "UseRegularNms=" << detection_info.use_regular_nms() << ","
2197  << "DetectionPerClass=" << detection_info.detection_per_class()
2198  << "}";
2199 
2200  return os;
2201 }
2202 
2203 /** Formatted output of the DetectionPostProcessLayerInfo type.
2204  *
2205  * @param[in] detection_info Type to output
2206  *
2207  * @return Formatted string.
2208  */
2209 inline std::string to_string(const DetectionPostProcessLayerInfo &detection_info)
2210 {
2211  std::stringstream str;
2212  str << detection_info;
2213  return str.str();
2214 }
2215 /** Formatted output of the DetectionWindow type.
2216  *
2217  * @param[in] detection_window Type to output
2218  *
2219  * @return Formatted string.
2220  */
2221 inline std::string to_string(const DetectionWindow &detection_window)
2222 {
2223  std::stringstream str;
2224  str << detection_window;
2225  return str.str();
2226 }
2227 
2228 /** Formatted output of the Termination type.
2229  *
2230  * @param[out] os Output stream
2231  * @param[in] termination Type to output
2232  *
2233  * @return Modified output stream.
2234  */
2235 inline ::std::ostream &operator<<(::std::ostream &os, const Termination &termination)
2236 {
2237  switch(termination)
2238  {
2240  os << "TERM_CRITERIA_EPSILON";
2241  break;
2243  os << "TERM_CRITERIA_ITERATIONS";
2244  break;
2246  os << "TERM_CRITERIA_BOTH";
2247  break;
2248  default:
2249  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2250  }
2251 
2252  return os;
2253 }
2254 
2255 /** Formatted output of the Termination type.
2256  *
2257  * @param[in] termination Type to output
2258  *
2259  * @return Formatted string.
2260  */
2261 inline std::string to_string(const Termination &termination)
2262 {
2263  std::stringstream str;
2264  str << termination;
2265  return str.str();
2266 }
2267 
2268 /** Formatted output of the CPUModel type.
2269  *
2270  * @param[out] os Output stream
2271  * @param[in] cpu_model Model to output
2272  *
2273  * @return Modified output stream.
2274  */
2275 inline ::std::ostream &operator<<(::std::ostream &os, const CPUModel &cpu_model)
2276 {
2277  switch(cpu_model)
2278  {
2279  case CPUModel::GENERIC:
2280  os << "GENERIC";
2281  break;
2283  os << "GENERIC_FP16";
2284  break;
2286  os << "GENERIC_FP16_DOT";
2287  break;
2288  case CPUModel::A53:
2289  os << "A53";
2290  break;
2291  case CPUModel::A55r0:
2292  os << "A55r0";
2293  break;
2294  case CPUModel::A55r1:
2295  os << "A55r1";
2296  break;
2297  case CPUModel::A73:
2298  os << "A73";
2299  break;
2300  case CPUModel::X1:
2301  os << "X1";
2302  break;
2303  default:
2304  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2305  }
2306 
2307  return os;
2308 }
2309 
2310 /** Formatted output of the CPUModel type.
2311  *
2312  * @param[in] cpu_model Model to output
2313  *
2314  * @return Formatted string.
2315  */
2316 inline std::string to_string(const CPUModel &cpu_model)
2317 {
2318  std::stringstream str;
2319  str << cpu_model;
2320  return str.str();
2321 }
2322 /** Formatted output of a vector of objects.
2323  *
2324  * @param[out] os Output stream
2325  * @param[in] args Vector of objects to print
2326  *
2327  * @return Modified output stream.
2328  */
2329 template <typename T>
2330 inline ::std::ostream &operator<<(::std::ostream &os, const std::vector<T> &args)
2331 {
2332  os << "[";
2333  bool first = true;
2334  for(auto &arg : args)
2335  {
2336  if(first)
2337  {
2338  first = false;
2339  }
2340  else
2341  {
2342  os << ", ";
2343  }
2344  os << arg;
2345  }
2346  os << "]";
2347  return os;
2348 }
2349 
2350 /** Formatted output of @ref PriorBoxLayerInfo.
2351  *
2352  * @param[out] os Output stream.
2353  * @param[in] info Type to output.
2354  *
2355  * @return Modified output stream.
2356  */
2357 inline ::std::ostream &operator<<(::std::ostream &os, const PriorBoxLayerInfo &info)
2358 {
2359  os << "Clip:" << info.clip()
2360  << "Flip:" << info.flip()
2361  << "StepX:" << info.steps()[0]
2362  << "StepY:" << info.steps()[1]
2363  << "MinSizes:" << info.min_sizes()
2364  << "MaxSizes:" << info.max_sizes()
2365  << "ImgSizeX:" << info.img_size().x
2366  << "ImgSizeY:" << info.img_size().y
2367  << "Offset:" << info.offset()
2368  << "Variances:" << info.variances();
2369 
2370  return os;
2371 }
2372 
2373 /** Formatted output of a vector of objects.
2374  *
2375  * @param[in] args Vector of objects to print
2376  *
2377  * @return String representing args.
2378  */
2379 template <typename T>
2380 std::string to_string(const std::vector<T> &args)
2381 {
2382  std::stringstream str;
2383  str << args;
2384  return str.str();
2385 }
2386 
2387 /** Formatted output of the WinogradInfo type. */
2388 inline ::std::ostream &operator<<(::std::ostream &os, const WinogradInfo &info)
2389 {
2390  os << "{OutputTileSize=" << info.output_tile_size << ","
2391  << "KernelSize=" << info.kernel_size << ","
2392  << "PadStride=" << info.convolution_info << ","
2393  << "OutputDataLayout=" << info.output_data_layout << "}";
2394 
2395  return os;
2396 }
2397 
2398 inline std::string to_string(const WinogradInfo &type)
2399 {
2400  std::stringstream str;
2401  str << type;
2402  return str.str();
2403 }
2404 
2405 /** Fallback method: try to use std::to_string:
2406  *
2407  * @param[in] val Value to convert to string
2408  *
2409  * @return String representing val.
2410  */
2411 template <typename T>
2412 inline std::string to_string(const T &val)
2413 {
2414  return support::cpp11::to_string(val);
2415 }
2416 
2417 /** Convert a CLTunerMode value to a string
2418  *
2419  * @param val CLTunerMode value to be converted
2420  *
2421  * @return String representing the corresponding CLTunerMode.
2422  */
2423 inline std::string to_string(const CLTunerMode val)
2424 {
2425  switch(val)
2426  {
2428  {
2429  return std::string("Exhaustive");
2430  }
2431  case CLTunerMode::NORMAL:
2432  {
2433  return std::string("Normal");
2434  }
2435  case CLTunerMode::RAPID:
2436  {
2437  return std::string("Rapid");
2438  }
2439  default:
2440  {
2441  ARM_COMPUTE_ERROR("Invalid tuner mode.");
2442  return std::string("UNDEFINED");
2443  }
2444  }
2445 }
2446 /** Converts a @ref CLGEMMKernelType to string
2447  *
2448  * @param[in] val CLGEMMKernelType value to be converted
2449  *
2450  * @return String representing the corresponding CLGEMMKernelType
2451  */
2452 inline std::string to_string(CLGEMMKernelType val)
2453 {
2454  switch(val)
2455  {
2457  {
2458  return "Native_V1";
2459  }
2461  {
2462  return "Reshaped_V1";
2463  }
2465  {
2466  return "Native";
2467  }
2469  {
2470  return "Reshaped_Only_RHS";
2471  }
2473  {
2474  return "Reshaped";
2475  }
2476  default:
2477  {
2478  return "Unknown";
2479  }
2480  }
2481 }
2482 /** [Print CLTunerMode type] **/
2483 /** Formatted output of the CLTunerMode type.
2484  *
2485  * @param[out] os Output stream.
2486  * @param[in] val CLTunerMode to output.
2487  *
2488  * @return Modified output stream.
2489  */
2490 inline ::std::ostream &operator<<(::std::ostream &os, const CLTunerMode &val)
2491 {
2492  os << to_string(val);
2493  return os;
2494 }
2495 
2496 } // namespace arm_compute
2497 
2498 #endif /* __ARM_COMPUTE_TYPE_PRINTER_H__ */
BorderMode
Methods available to handle borders.
Definition: Types.h:265
Rectangle type.
Definition: Types.h:454
unsigned int top
top of the border
Definition: Types.h:375
L2-norm followed by clipping.
size_t num_bins() const
The number of histogram bins for each cell.
Definition: HOGInfo.cpp:111
A single plane of 32-bit macro pixel of U0, Y0, V0, Y1 byte.
bool broadcast_bias
Flag used to broadcast the bias addition.
ArithmeticOperation
Available element-wise operations.
Definition: Types.h:534
InterpolationPolicy
Interpolation method.
Definition: Types.h:392
int num_classes() const
Get num classes.
Definition: Types.h:1025
int mult_interleave4x4_height() const
Multiplication factor for the height of the 4x4 interleaved block.
Definition: Types.h:1893
int mult_interleave4x4_height
Multiplication factor for the height of the 4x4 interleaved block.
float scale
Scale initialized to 0 by the corner detector.
Definition: Types.h:444
Generate Proposals Information class.
Definition: Types.h:1352
Second channel (used by formats with unknown channel types).
Shape of a tensor.
Definition: TensorShape.h:39
const Size2D & detection_window_size() const
The detection window size in pixels.
Definition: HOGInfo.cpp:101
bool share_location() const
Get share location.
Definition: Types.h:1030
float scale_value_x() const
Get x scale value.
Definition: Types.h:1178
DataLayout output_data_layout
Data layout to use for the output tensor once the convolution has been applied (NCHW or NHWC) ...
Definition: Types.h:2201
bool fp_mixed_precision
Flag used to indicate wider accumulators (32 bit instead of 16 for FP16).
quantized, symmetric fixed-point 16-bit number
Rounds to nearest value; half rounds away from zero.
L1 normalization type.
Descriptor used by the GEMM kernels.
uint16_t x
Top-left x coordinate.
Definition: Types.h:592
float score
Confidence value for the detection window.
Definition: Types.h:597
Angle range: [0, 180].
bool enabled() const
Check if initialised.
Definition: Types.h:1600
std::vector< PaddingInfo > PaddingList
List of padding information.
Definition: Types.h:481
ReductionOperation
Available reduction operations.
Definition: Types.h:521
const Size2D & cell_size() const
The cell size in pixels.
Definition: HOGInfo.cpp:91
Container for 2D border size.
Definition: Types.h:273
size_t num_channels() const override
The number of channels for each tensor element.
Definition: TensorInfo.h:258
int32_t x
X coordinates.
Definition: Types.h:441
Angle range: [0, 360].
PhaseType
Phase calculation type.
Definition: Types.h:432
unsigned int max_detections() const
Get max detections.
Definition: Types.h:1137
float orientation
Orientation initialized to 0 by the corner detector.
Definition: Types.h:445
Cr/V/Value channel.
unsigned int v0
Number of vertical blocks of size (m0xk0) stored on the same output row.
Definition: Types.h:1977
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:352
constexpr int step() const
Return the step of the dimension.
Definition: Window.h:104
unsigned int depth_output_gemm3d
Depth of the output tensor in case is reinterpreted as 3D.
DataLayoutDimension
[DataLayout enum definition]
Definition: Types.h:129
Winograd information.
Definition: Types.h:2182
uint32_t norm_size() const
Get the normalization size.
Definition: Types.h:1670
1 channel, 1 U8 per channel
NormType type() const
Get the normalization type.
Definition: Types.h:1665
int mult_transpose1xW_width() const
Multiplication factor for the width of the 1xW transposed block.
Definition: Types.h:1885
int32_t tracking_status
Status initialized to 1 by the corner detector, set to 0 when the point is lost.
Definition: Types.h:446
Terminate when within epsilon of a threshold.
GEMM reshape information class.
Definition: Types.h:1831
PadStrideInfo convolution_info
Convolution info (Pads, strides,...)
Definition: Types.h:2200
std::string to_string(T &&value)
Convert integer and float values to string.
Store the HOG&#39;s metadata.
Definition: HOGInfo.h:35
bool are_reshaped() const
Flag which specifies if the weights tensor has been reshaped.
Definition: Types.h:1789
1 channel, 1 F32 per channel
Normalization Layer Information class.
Definition: Types.h:1647
Unknown channel format.
Output values are defined by bilinear interpolation between the pixels.
unsigned int h0
Number of horizontal blocks of size (k0xn0) stored on the same output row.
Definition: Types.h:1992
const DataLayout data_layout
Definition: Im2Col.cpp:151
bool fp_mixed_precision() const
Flag which specifies if a wider accumulator should be used.
Definition: Types.h:2122
GEMM LHS (Left Hand Side) matrix information.
Definition: Types.h:1968
bool pretranpose_B() const
Flag which specifies whether b should be pre-transposed if supported.
Definition: Types.h:2138
A 2 plane YUV format of Luma (Y) and interleaved UV data at 4:2:0 sampling.
Terminate after a maximum number of iterations.
Quantization info when assuming per layer quantization.
Describe one of the image&#39;s dimensions with a start, end and step.
Definition: Window.h:77
quantized, asymmetric fixed-point 16-bit number
1 channel, 1 U16 per channel
unsigned int bottom
bottom of the border
Definition: Types.h:377
CPUModel
CPU models - we only need to detect CPUs we have microarchitecture-specific code for.
Definition: CPPTypes.h:40
Reshaped GEMM kernel where only the rhs matrix is reshaped.
float eta() const
Get eta.
Definition: Types.h:1055
int depth_output_gemm3d() const
Depth of the output when GEMM output is reinterpreted as 3D tensor.
Definition: Types.h:2082
unsigned int pooled_width() const
Get the pooled width of the layer.
Definition: Types.h:1324
unsigned int pad_top() const
Get the top padding.
Definition: Types.h:806
Output values are defined to match the source pixel whose center is nearest to the sample position...
bool retain_internal_weights() const
Flag which specifies if the weights tensor has to be retained from previous run.
Definition: Types.h:2098
CLGEMMKernelType
OpenCL GEMM kernel types.
Definition: CLTypes.h:31
DetectionOutputLayerCodeType
Available Detection Output code types.
Definition: Types.h:967
ConvolutionMethod
Available ConvolutionMethod.
Definition: Types.h:138
Reshaped GEMM kernel where both lhs and rhs matrices are reshaped.
Activation Layer Information class.
Definition: Types.h:1550
decltype(strategy::transforms) typedef type
PhaseType phase_type() const
The type of PhaseType.
Definition: HOGInfo.cpp:126
float spatial_scale() const
Definition: Types.h:1464
const Size2D & block_stride() const
The block stride in pixels.
Definition: HOGInfo.cpp:106
Terminate on whichever of the other conditions occurs first.
A 2 plane YUV format of Luma (Y) and interleaved VU data at 4:2:0 sampling.
bool use_regular_nms() const
Get if use regular nms.
Definition: Types.h:1167
HOGNormType normalization_type() const
The normalization type.
Definition: HOGInfo.cpp:116
bool transpose
True if the (k0xn0) block has to be transposed before been stored.
Definition: Types.h:1993
bool interleave
True if the v0 (m0xk0) blocks have to be interleaved in the output row.
Definition: Types.h:1979
bool export_to_cl_image
True if the reshaped rhs has to be exported to cl_image.
Definition: Types.h:1995
int top_k() const
Get top K.
Definition: Types.h:1070
Copyright (c) 2017-2021 Arm Limited.
size_t height
Height of the image region or rectangle.
Definition: Size2D.h:90
bool is_b_reshaped() const
Flag which specifies if the matrix B has been reshaped.
Definition: Types.h:2064
int32_t x
X coordinates.
Definition: Types.h:465
ActivationFunction
Available activation functions.
Definition: Types.h:1554
1 channel, 1 F16 per channel
Samples are taken at pixel center.
float iou_threshold() const
Get intersection over union threshold.
Definition: Types.h:1157
Keypoint type.
Definition: Types.h:439
float strength
Strength of the point.
Definition: Types.h:443
DataType data_type() const override
Data type used for each element of the tensor.
Definition: TensorInfo.h:270
Convolution Layer Weights Information class.
Definition: Types.h:1765
1 channel, 1 S32 per channel
bool variance_encoded_in_target() const
Get if variance encoded in target.
Definition: Types.h:1040
16-bit brain floating-point number
bool transpose
True if the (m0xk0) block has to be transposed before been stored.
Definition: Types.h:1978
signed 64-bit number
int n() const
Number of matrix B columns.
Definition: Types.h:1869
Searches a minimal subset of LWS configurations while tuning.
Native GEMM kernel with fixed block size.
3 channels, 1 U8 per channel
const DataType data_type
Definition: Im2Col.cpp:150
unsigned int k0
Number of partial accumulations performed by the matrix multiplication.
Definition: Types.h:1991
unsigned int m
Number of LHS rows.
Quantization information.
unsigned int n
Number of RHS columns.
float error
Tracking error initialized to 0 by the corner detector.
Definition: Types.h:447
int32_t y
Y coordinates.
Definition: Types.h:466
std::array< float, 2 > steps() const
Get the step coordinates.
Definition: Types.h:914
float nms_threshold() const
Get nms threshold.
Definition: Types.h:1050
Third channel (used by formats with unknown channel types).
1 channel, 1 U32 per channel
GEMM RHS (Right Hand Side) matrix information.
Definition: Types.h:1983
int32_t b_offset
Offset to be added to each element of the matrix B.
Normalization applied within the same map in 1D region.
Size2D output_tile_size
Width and height of the output tile.
Definition: Types.h:2197
Channel
Available channels.
Definition: Types.h:487
Format
Image colour formats.
Definition: Types.h:54
PaddingMode
Padding mode to use for PadLayer.
Definition: Types.h:169
uint16_t width
Width of the detection window.
Definition: Types.h:594
unsigned int n0
Number of columns processed by the matrix multiplication.
Definition: Types.h:1990
quantized, asymmetric fixed-point 8-bit number unsigned
const Size2D & block_size() const
The block size in pixels.
Definition: HOGInfo.cpp:96
Coordinates of an item.
Definition: Coordinates.h:37
float scale_value_h() const
Get h scale value.
Definition: Types.h:1184
std::pair< unsigned int, unsigned int > stride() const
Get the stride.
Definition: Types.h:770
float scale_value_w() const
Get w scale value.
Definition: Types.h:1190
Pooling Layer Information struct.
Definition: Types.h:1214
UniformQuantizationInfo uniform() const
Return per layer quantization info.
float nms_score_threshold() const
Get nms threshold.
Definition: Types.h:1152
Dimensions with dimensionality.
Definition: Dimensions.h:42
bool reinterpret_input_as_3d
Flag used to reinterpret the input as 3D.
RoundingPolicy
Rounding method.
Definition: Rounding.h:30
A 3 plane of 8 bit 4:4:4 sampled Y, U, V planes.
Samples are taken at pixel top left corner.
PriorBox layer info.
Definition: Types.h:839
float offset() const
Get the offset.
Definition: Types.h:924
Fourth channel (used by formats with unknown channel types).
DetectionOutputLayerCodeType code_type() const
Get detection output code type.
Definition: Types.h:1035
unsigned int pad_right() const
Get the right padding.
Definition: Types.h:801
int k() const
Number of matrix A columns or matrix B rows.
Definition: Types.h:1877
float l2_hyst_threshold() const
Threshold used for L2HYS_NORM normalization type.
Definition: HOGInfo.cpp:121
Padding and stride information class.
Definition: Types.h:722
ComparisonOperation
Supported comparison operations.
Definition: Types.h:177
Termination
Termination criteria.
Definition: Types.h:414
Coordinates2D img_size() const
Get the image size coordinates.
Definition: Types.h:919
unsigned int num_kernels() const
Return the number of convolution kernels.
Definition: Types.h:1797
bool reinterpret_input_as_3d() const
Flag which specifies if the input tensor has to be reinterpreted as 3D.
Definition: Types.h:2090
Bounding Box Transform information class.
Definition: Types.h:1483
unsigned int left
left of the border
Definition: Types.h:378
unsigned int right
right of the border
Definition: Types.h:376
1 channel, 1 S16 per channel
L2 normalization type.
bool broadcast_bias() const
Flag which specifies whether to broadcast the shape of the bias tensor.
Definition: Types.h:2130
uint16_t idx_class
Index of the class.
Definition: Types.h:596
int keep_top_k() const
Get the number of total bounding boxes to be kept per image.
Definition: Types.h:1045
Output values are determined by averaging the source pixels whose areas fall under the area of the de...
quantized, symmetric fixed-point 8-bit number
Num samples, channels, height, width.
unsigned int max_classes_per_detection() const
Get max_classes per detection.
Definition: Types.h:1142
int32_t y
Y coordinates.
Definition: Types.h:442
bool is_a_reshaped() const
Flag which specifies if the matrix A has been reshaped.
Definition: Types.h:2056
float scale_value_y() const
Get y scale value.
Definition: Types.h:1172
uint16_t height
Height of the detection window.
Definition: Types.h:595
Strides of an item in bytes.
Definition: Strides.h:37
quantized, symmetric per channel fixed-point 8-bit number
Convolution using Winograd.
A 3 plane of 8-bit 4:2:0 sampled Y, U, V planes.
int32_t a_offset
Offset to be added to each element of the matrix A.
Detection Output layer info.
Definition: Types.h:976
4 channels, 1 U8 per channel
PoolingType
Available pooling types.
Definition: Types.h:610
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
Rounds to nearest value; half rounds to nearest even.
PadStrideInfo pad_stride_info
Definition: Types.h:1302
size_t width
Width of the image region or rectangle.
Definition: Size2D.h:89
HOGNormType
Normalization type for Histogram of Oriented Gradients (HOG)
Definition: Types.h:577
GPUTarget
Available GPU Targets.
Definition: GPUTarget.h:34
unsigned int pooled_height() const
Get the pooled height of the layer.
Definition: Types.h:1329
int m() const
Number of matrix A rows.
Definition: Types.h:1861
Borders are left undefined.
ROI Pooling Layer Information class.
Definition: Types.h:1309
Pixels outside the image are assumed to have the same value as the closest image pixel.
Native GEMM kernel with configurable block size.
Class for specifying the size of an image or rectangle.
Definition: Size2D.h:34
Detection window used for the object detection.
Definition: Types.h:590
const QuantizationInfo qinfo
Definition: Im2Col.cpp:155
std::vector< float > max_sizes() const
Get max sizes.
Definition: Types.h:939
ComputeAnchors information class.
Definition: Types.h:1433
CLTunerMode
< OpenCL tuner modes
Definition: CLTunerTypes.h:35
uint16_t width
Width of the rectangle.
Definition: Types.h:458
Num samples, height, width, channels.
std::string to_string(const ICLTensor &arg)
unsigned int detection_per_class() const
Get detection per class.
Definition: Types.h:1147
bool flip() const
Get the flip value.
Definition: Types.h:929
2 channel, 1 U8 per channel
uint16_t y
Top-left y coordinate.
Definition: Types.h:593
unsigned int k
Number of LHS columns or RHS rows.
float spatial_scale() const
Get the spatial scale.
Definition: Types.h:1334
uint16_t y
Top-left y coordinate.
Definition: Types.h:457
Detection Output layer info.
Definition: Types.h:1095
bool interleave
True if the h0 (k0xn0) blocks have to be interleaved in the output row.
Definition: Types.h:1994
unsigned int num_classes() const
Get num classes.
Definition: Types.h:1162
Use box centers and size but flip x and y co-ordinates.
std::vector< float > variances() const
Get min variances.
Definition: Types.h:909
Size2D kernel_size
Width and height of the kernel.
Definition: Types.h:2198
std::array< float, 4 > weights() const
Definition: Types.h:1504
Store the tensor&#39;s metadata.
Definition: TensorInfo.h:45
bool reshape_b_only_on_first_run() const
Flag which specifies if the reshape of matrix B should executed only for the first.
Definition: Types.h:2074
unsigned int k0
Number of partial accumulations performed by the matrix multiplication.
Definition: Types.h:1976
uint16_t x
Top-left x coordinate.
Definition: Types.h:456
GEMM information class.
Definition: Types.h:2003
unsigned int m0
Number of rows processed by the matrix multiplication.
Definition: Types.h:1975
ActivationFunction activation() const
Get the type of activation function.
Definition: Types.h:1585
quantized, asymmetric fixed-point 8-bit number signed
64-bit floating-point number
constexpr int end() const
Return the end of the dimension.
Definition: Window.h:99
MagnitudeType
Magnitude calculation type.
Definition: Types.h:422
int mult_transpose1xW_width
Multiplication factor for the width of the 1xW transposed block.
uint16_t height
Height of the rectangle.
Definition: Types.h:459
unsigned int pad_bottom() const
Get the bottom padding.
Definition: Types.h:811
A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes.
bool clip() const
Get the clip value.
Definition: Types.h:934
const TensorShape & tensor_shape() const override
Size for each dimension of the tensor.
Definition: TensorInfo.h:262
static constexpr size_t num_max_dimensions
Number of dimensions the tensor has.
Definition: Dimensions.h:46
unsigned 64-bit number
Cross pattern matrix.
DataType
Available data types.
Definition: Types.h:77
Truncates the least significant values that are lost in operations.
unsigned int pad_left() const
Get the left padding.
Definition: Types.h:796
Reshaped GEMM kernel where both lhs and rhs matrices are reshaped.
Searches all possible LWS configurations while tuning.
ElementWiseUnary
Available element wise unary operations.
Definition: Types.h:547
DataLayout
[DataLayout enum definition]
Definition: Types.h:120
std::vector< uint32_t > Multiples
Information to produce a tiled version of a Tensor.
Definition: Types.h:484
constexpr int start() const
Return the start of the dimension.
Definition: Window.h:94
NormType
The normalization type used for the normalization layer.
Definition: Types.h:569
signed 8-bit number
MatrixPattern
Available matrix patterns.
Definition: Types.h:504
Normalization applied cross maps.
Any other matrix pattern.
Convolution using GEMM.
Describe a multidimensional execution window.
Definition: Window.h:39
ConvertPolicy
Policy to handle overflow.
Definition: Types.h:385
int background_label_id() const
Get background label ID.
Definition: Types.h:1060
NonLinearFilterFunction
Available non linear functions.
Definition: Types.h:513
float confidence_threshold() const
Get confidence threshold.
Definition: Types.h:1065
Normalization applied within the same map in 2D region.
SamplingPolicy
Available Sampling Policies.
Definition: Types.h:102
std::pair< unsigned int, unsigned int > kernel_size() const
Return the width and height of the kernel.
Definition: Types.h:1805
int num_loc_classes() const
Get number of location classes.
Definition: Types.h:1075
std::string to_string_if_not_null(T *arg)
Formatted output if arg is not null.
Definition: TypePrinter.h:54
std::vector< float > min_sizes() const
Get min sizes.
Definition: Types.h:904
TracePoint::Args && operator<<(TracePoint::Args &&tp, const ICLTensor *arg)