Compute Library
 21.08
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 
28 #include "arm_compute/core/Error.h"
34 #include "arm_compute/core/Types.h"
37 #include "support/StringSupport.h"
38 
39 #include <ostream>
40 #include <sstream>
41 #include <string>
42 
43 namespace arm_compute
44 {
45 /** Formatted output if arg is not null
46  *
47  * @param[in] arg Object to print
48  *
49  * @return String representing arg.
50  */
51 template <typename T>
52 std::string to_string_if_not_null(T *arg)
53 {
54  if(arg == nullptr)
55  {
56  return "nullptr";
57  }
58  else
59  {
60  return to_string(*arg);
61  }
62 }
63 
64 /** Formatted output of the Dimensions type.
65  *
66  * @param[out] os Output stream.
67  * @param[in] dimensions Type to output.
68  *
69  * @return Modified output stream.
70  */
71 template <typename T>
72 inline ::std::ostream &operator<<(::std::ostream &os, const Dimensions<T> &dimensions)
73 {
74  if(dimensions.num_dimensions() > 0)
75  {
76  os << dimensions[0];
77 
78  for(unsigned int d = 1; d < dimensions.num_dimensions(); ++d)
79  {
80  os << "," << dimensions[d];
81  }
82  }
83 
84  return os;
85 }
86 
87 /** Formatted output of the RoundingPolicy type.
88  *
89  * @param[out] os Output stream.
90  * @param[in] rounding_policy Type to output.
91  *
92  * @return Modified output stream.
93  */
94 inline ::std::ostream &operator<<(::std::ostream &os, const RoundingPolicy &rounding_policy)
95 {
96  switch(rounding_policy)
97  {
99  os << "TO_ZERO";
100  break;
102  os << "TO_NEAREST_UP";
103  break;
105  os << "TO_NEAREST_EVEN";
106  break;
107  default:
108  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
109  }
110 
111  return os;
112 }
113 
114 /** Formatted output of the WeightsInfo type.
115  *
116  * @param[out] os Output stream.
117  * @param[in] weights_info Type to output.
118  *
119  * @return Modified output stream.
120  */
121 inline ::std::ostream &operator<<(::std::ostream &os, const WeightsInfo &weights_info)
122 {
123  os << weights_info.are_reshaped() << ";";
124  os << weights_info.num_kernels() << ";" << weights_info.kernel_size().first << "," << weights_info.kernel_size().second;
125 
126  return os;
127 }
128 
129 /** Formatted output of the ROIPoolingInfo type.
130  *
131  * @param[out] os Output stream.
132  * @param[in] pool_info Type to output.
133  *
134  * @return Modified output stream.
135  */
136 inline ::std::ostream &operator<<(::std::ostream &os, const ROIPoolingLayerInfo &pool_info)
137 {
138  os << pool_info.pooled_width() << "x" << pool_info.pooled_height() << "~" << pool_info.spatial_scale();
139  return os;
140 }
141 
142 /** Formatted output of the ROIPoolingInfo type.
143  *
144  * @param[in] pool_info Type to output.
145  *
146  * @return Formatted string.
147  */
148 inline std::string to_string(const ROIPoolingLayerInfo &pool_info)
149 {
150  std::stringstream str;
151  str << pool_info;
152  return str.str();
153 }
154 
155 /** Formatted output of the GEMMKernelInfo type.
156  *
157  * @param[out] os Output stream.
158  * @param[in] gemm_info Type to output.
159  *
160  * @return Modified output stream.
161  */
162 inline ::std::ostream &operator<<(::std::ostream &os, const GEMMKernelInfo &gemm_info)
163 {
164  os << "( m= " << gemm_info.m;
165  os << " n= " << gemm_info.n;
166  os << " k= " << gemm_info.k;
167  os << " depth_output_gemm3d= " << gemm_info.depth_output_gemm3d;
168  os << " reinterpret_input_as_3d= " << gemm_info.reinterpret_input_as_3d;
169  os << " broadcast_bias= " << gemm_info.broadcast_bias;
170  os << " fp_mixed_precision= " << gemm_info.fp_mixed_precision;
171  os << " mult_transpose1xW_width= " << gemm_info.mult_transpose1xW_width;
172  os << " mult_interleave4x4_height= " << gemm_info.mult_interleave4x4_height;
173  os << " a_offset = " << gemm_info.a_offset;
174  os << " b_offset = " << gemm_info.b_offset;
175  os << ")";
176  return os;
177 }
178 
179 /** Formatted output of the GEMMLHSMatrixInfo type.
180  *
181  * @param[out] os Output stream.
182  * @param[in] gemm_info Type to output.
183  *
184  * @return Modified output stream.
185  */
186 inline ::std::ostream &operator<<(::std::ostream &os, const GEMMLHSMatrixInfo &gemm_info)
187 {
188  os << "( m0= " << (unsigned int)gemm_info.m0 << " k0= " << gemm_info.k0 << " v0= " << gemm_info.v0 << " trans= " << gemm_info.transpose << " inter= " << gemm_info.interleave << "})";
189  return os;
190 }
191 
192 /** Formatted output of the GEMMRHSMatrixInfo type.
193  *
194  * @param[out] os Output stream.
195  * @param[in] gemm_info Type to output.
196  *
197  * @return Modified output stream.
198  */
199 inline ::std::ostream &operator<<(::std::ostream &os, const GEMMRHSMatrixInfo &gemm_info)
200 {
201  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=" <<
202  gemm_info.export_to_cl_image << "})";
203  return os;
204 }
205 
206 /** Formatted output of the GEMMRHSMatrixInfo type.
207  *
208  * @param[in] gemm_info GEMMRHSMatrixInfo to output.
209  *
210  * @return Formatted string.
211  */
212 inline std::string to_string(const GEMMRHSMatrixInfo &gemm_info)
213 {
214  std::stringstream str;
215  str << gemm_info;
216  return str.str();
217 }
218 
219 /** Formatted output of the GEMMLHSMatrixInfo type.
220  *
221  * @param[in] gemm_info GEMMLHSMatrixInfo to output.
222  *
223  * @return Formatted string.
224  */
225 inline std::string to_string(const GEMMLHSMatrixInfo &gemm_info)
226 {
227  std::stringstream str;
228  str << gemm_info;
229  return str.str();
230 }
231 
232 /** Formatted output of the GEMMKernelInfo type.
233  *
234  * @param[in] gemm_info GEMMKernelInfo Type to output.
235  *
236  * @return Formatted string.
237  */
238 inline std::string to_string(const GEMMKernelInfo &gemm_info)
239 {
240  std::stringstream str;
241  str << gemm_info;
242  return str.str();
243 }
244 
245 /** Formatted output of the BoundingBoxTransformInfo type.
246  *
247  * @param[out] os Output stream.
248  * @param[in] bbox_info Type to output.
249  *
250  * @return Modified output stream.
251  */
252 inline ::std::ostream &operator<<(::std::ostream &os, const BoundingBoxTransformInfo &bbox_info)
253 {
254  auto weights = bbox_info.weights();
255  os << "(" << bbox_info.img_width() << "x" << bbox_info.img_height() << ")~" << bbox_info.scale() << "(weights = {" << weights[0] << ", " << weights[1] << ", " << weights[2] << ", " << weights[3] <<
256  "})";
257  return os;
258 }
259 
260 /** Formatted output of the BoundingBoxTransformInfo type.
261  *
262  * @param[in] bbox_info Type to output.
263  *
264  * @return Formatted string.
265  */
266 inline std::string to_string(const BoundingBoxTransformInfo &bbox_info)
267 {
268  std::stringstream str;
269  str << bbox_info;
270  return str.str();
271 }
272 
273 /** Formatted output of the ComputeAnchorsInfo type.
274  *
275  * @param[out] os Output stream.
276  * @param[in] anchors_info Type to output.
277  *
278  * @return Modified output stream.
279  */
280 inline ::std::ostream &operator<<(::std::ostream &os, const ComputeAnchorsInfo &anchors_info)
281 {
282  os << "(" << anchors_info.feat_width() << "x" << anchors_info.feat_height() << ")~" << anchors_info.spatial_scale();
283  return os;
284 }
285 
286 /** Formatted output of the ComputeAnchorsInfo type.
287  *
288  * @param[in] anchors_info Type to output.
289  *
290  * @return Formatted string.
291  */
292 inline std::string to_string(const ComputeAnchorsInfo &anchors_info)
293 {
294  std::stringstream str;
295  str << anchors_info;
296  return str.str();
297 }
298 
299 /** Formatted output of the GenerateProposalsInfo type.
300  *
301  * @param[out] os Output stream.
302  * @param[in] proposals_info Type to output.
303  *
304  * @return Modified output stream.
305  */
306 inline ::std::ostream &operator<<(::std::ostream &os, const GenerateProposalsInfo &proposals_info)
307 {
308  os << "(" << proposals_info.im_width() << "x" << proposals_info.im_height() << ")~" << proposals_info.im_scale();
309  return os;
310 }
311 
312 /** Formatted output of the GenerateProposalsInfo type.
313  *
314  * @param[in] proposals_info Type to output.
315  *
316  * @return Formatted string.
317  */
318 inline std::string to_string(const GenerateProposalsInfo &proposals_info)
319 {
320  std::stringstream str;
321  str << proposals_info;
322  return str.str();
323 }
324 
325 /** Formatted output of the QuantizationInfo type.
326  *
327  * @param[out] os Output stream.
328  * @param[in] qinfo Type to output.
329  *
330  * @return Modified output stream.
331  */
332 inline ::std::ostream &operator<<(::std::ostream &os, const QuantizationInfo &qinfo)
333 {
334  const UniformQuantizationInfo uqinfo = qinfo.uniform();
335  os << "Scale:" << uqinfo.scale << "~";
336  os << "Offset:" << uqinfo.offset;
337  return os;
338 }
339 
340 /** Formatted output of the QuantizationInfo type.
341  *
342  * @param[in] quantization_info Type to output.
343  *
344  * @return Formatted string.
345  */
346 inline std::string to_string(const QuantizationInfo &quantization_info)
347 {
348  std::stringstream str;
349  str << quantization_info;
350  return str.str();
351 }
352 
353 /** Formatted output of the activation function type.
354  *
355  * @param[out] os Output stream.
356  * @param[in] act_function Type to output.
357  *
358  * @return Modified output stream.
359  */
360 inline ::std::ostream &operator<<(::std::ostream &os, const ActivationLayerInfo::ActivationFunction &act_function)
361 {
362  switch(act_function)
363  {
365  os << "ABS";
366  break;
368  os << "LINEAR";
369  break;
371  os << "LOGISTIC";
372  break;
374  os << "RELU";
375  break;
377  os << "BOUNDED_RELU";
378  break;
380  os << "LEAKY_RELU";
381  break;
383  os << "SOFT_RELU";
384  break;
386  os << "SQRT";
387  break;
389  os << "LU_BOUNDED_RELU";
390  break;
392  os << "ELU";
393  break;
395  os << "SQUARE";
396  break;
398  os << "TANH";
399  break;
401  os << "IDENTITY";
402  break;
404  os << "HARD_SWISH";
405  break;
406 
407  default:
408  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
409  }
410 
411  return os;
412 }
413 
414 /** Formatted output of the activation function info type.
415  *
416  * @param[in] info Type to output.
417  *
418  * @return Formatted string.
419  */
421 {
422  std::stringstream str;
423  if(info.enabled())
424  {
425  str << info.activation();
426  }
427  return str.str();
428 }
429 
430 /** Formatted output of the activation function type.
431  *
432  * @param[in] function Type to output.
433  *
434  * @return Formatted string.
435  */
437 {
438  std::stringstream str;
439  str << function;
440  return str.str();
441 }
442 
443 /** Formatted output of the NormType type.
444  *
445  * @param[out] os Output stream.
446  * @param[in] norm_type Type to output.
447  *
448  * @return Modified output stream.
449  */
450 inline ::std::ostream &operator<<(::std::ostream &os, const NormType &norm_type)
451 {
452  switch(norm_type)
453  {
454  case NormType::CROSS_MAP:
455  os << "CROSS_MAP";
456  break;
457  case NormType::IN_MAP_1D:
458  os << "IN_MAP_1D";
459  break;
460  case NormType::IN_MAP_2D:
461  os << "IN_MAP_2D";
462  break;
463  default:
464  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
465  }
466 
467  return os;
468 }
469 
470 /** Formatted output of @ref NormalizationLayerInfo.
471  *
472  * @param[in] info Type to output.
473  *
474  * @return Formatted string.
475  */
477 {
478  std::stringstream str;
479  str << info.type() << ":NormSize=" << info.norm_size();
480  return str.str();
481 }
482 
483 /** Formatted output of @ref NormalizationLayerInfo.
484  *
485  * @param[out] os Output stream.
486  * @param[in] info Type to output.
487  *
488  * @return Modified output stream.
489  */
490 inline ::std::ostream &operator<<(::std::ostream &os, const NormalizationLayerInfo &info)
491 {
492  os << info.type() << ":NormSize=" << info.norm_size();
493  return os;
494 }
495 
496 /** Formatted output of the PoolingType type.
497  *
498  * @param[out] os Output stream.
499  * @param[in] pool_type Type to output.
500  *
501  * @return Modified output stream.
502  */
503 inline ::std::ostream &operator<<(::std::ostream &os, const PoolingType &pool_type)
504 {
505  switch(pool_type)
506  {
507  case PoolingType::AVG:
508  os << "AVG";
509  break;
510  case PoolingType::MAX:
511  os << "MAX";
512  break;
513  case PoolingType::L2:
514  os << "L2";
515  break;
516  default:
517  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
518  }
519 
520  return os;
521 }
522 
523 /** Formatted output of @ref PoolingLayerInfo.
524  *
525  * @param[out] os Output stream.
526  * @param[in] info Type to output.
527  *
528  * @return Modified output stream.
529  */
530 inline ::std::ostream &operator<<(::std::ostream &os, const PoolingLayerInfo &info)
531 {
532  os << info.pool_type;
533 
534  return os;
535 }
536 
537 /** Formatted output of @ref RoundingPolicy.
538  *
539  * @param[in] rounding_policy Type to output.
540  *
541  * @return Formatted string.
542  */
543 inline std::string to_string(const RoundingPolicy &rounding_policy)
544 {
545  std::stringstream str;
546  str << rounding_policy;
547  return str.str();
548 }
549 
550 /** [Print DataLayout type] **/
551 /** Formatted output of the DataLayout type.
552  *
553  * @param[out] os Output stream.
554  * @param[in] data_layout Type to output.
555  *
556  * @return Modified output stream.
557  */
558 inline ::std::ostream &operator<<(::std::ostream &os, const DataLayout &data_layout)
559 {
560  switch(data_layout)
561  {
562  case DataLayout::UNKNOWN:
563  os << "UNKNOWN";
564  break;
565  case DataLayout::NHWC:
566  os << "NHWC";
567  break;
568  case DataLayout::NCHW:
569  os << "NCHW";
570  break;
571  default:
572  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
573  }
574 
575  return os;
576 }
577 
578 /** Formatted output of the DataLayout type.
579  *
580  * @param[in] data_layout Type to output.
581  *
582  * @return Formatted string.
583  */
585 {
586  std::stringstream str;
587  str << data_layout;
588  return str.str();
589 }
590 /** [Print DataLayout type] **/
591 
592 /** Formatted output of the DataLayoutDimension type.
593  *
594  * @param[out] os Output stream.
595  * @param[in] data_layout_dim Data layout dimension to print.
596  *
597  * @return Modified output stream.
598  */
599 inline ::std::ostream &operator<<(::std::ostream &os, const DataLayoutDimension &data_layout_dim)
600 {
601  switch(data_layout_dim)
602  {
604  os << "WIDTH";
605  break;
607  os << "HEIGHT";
608  break;
610  os << "CHANNEL";
611  break;
613  os << "BATCHES";
614  break;
615  default:
616  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
617  }
618  return os;
619 }
620 
621 /** Formatted output of the DataType type.
622  *
623  * @param[out] os Output stream.
624  * @param[in] data_type Type to output.
625  *
626  * @return Modified output stream.
627  */
628 inline ::std::ostream &operator<<(::std::ostream &os, const DataType &data_type)
629 {
630  switch(data_type)
631  {
632  case DataType::UNKNOWN:
633  os << "UNKNOWN";
634  break;
635  case DataType::U8:
636  os << "U8";
637  break;
638  case DataType::QSYMM8:
639  os << "QSYMM8";
640  break;
641  case DataType::QASYMM8:
642  os << "QASYMM8";
643  break;
645  os << "QASYMM8_SIGNED";
646  break;
648  os << "QSYMM8_PER_CHANNEL";
649  break;
650  case DataType::S8:
651  os << "S8";
652  break;
653  case DataType::U16:
654  os << "U16";
655  break;
656  case DataType::S16:
657  os << "S16";
658  break;
659  case DataType::QSYMM16:
660  os << "QSYMM16";
661  break;
662  case DataType::QASYMM16:
663  os << "QASYMM16";
664  break;
665  case DataType::U32:
666  os << "U32";
667  break;
668  case DataType::S32:
669  os << "S32";
670  break;
671  case DataType::U64:
672  os << "U64";
673  break;
674  case DataType::S64:
675  os << "S64";
676  break;
677  case DataType::BFLOAT16:
678  os << "BFLOAT16";
679  break;
680  case DataType::F16:
681  os << "F16";
682  break;
683  case DataType::F32:
684  os << "F32";
685  break;
686  case DataType::F64:
687  os << "F64";
688  break;
689  case DataType::SIZET:
690  os << "SIZET";
691  break;
692  default:
693  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
694  }
695 
696  return os;
697 }
698 
699 /** Formatted output of the DataType type.
700  *
701  * @param[in] data_type Type to output.
702  *
703  * @return Formatted string.
704  */
705 inline std::string to_string(const arm_compute::DataType &data_type)
706 {
707  std::stringstream str;
708  str << data_type;
709  return str.str();
710 }
711 
712 /** Formatted output of the Format type.
713  *
714  * @param[out] os Output stream.
715  * @param[in] format Type to output.
716  *
717  * @return Modified output stream.
718  */
719 inline ::std::ostream &operator<<(::std::ostream &os, const Format &format)
720 {
721  switch(format)
722  {
723  case Format::UNKNOWN:
724  os << "UNKNOWN";
725  break;
726  case Format::U8:
727  os << "U8";
728  break;
729  case Format::S16:
730  os << "S16";
731  break;
732  case Format::U16:
733  os << "U16";
734  break;
735  case Format::S32:
736  os << "S32";
737  break;
738  case Format::U32:
739  os << "U32";
740  break;
741  case Format::F16:
742  os << "F16";
743  break;
744  case Format::F32:
745  os << "F32";
746  break;
747  case Format::UV88:
748  os << "UV88";
749  break;
750  case Format::RGB888:
751  os << "RGB888";
752  break;
753  case Format::RGBA8888:
754  os << "RGBA8888";
755  break;
756  case Format::YUV444:
757  os << "YUV444";
758  break;
759  case Format::YUYV422:
760  os << "YUYV422";
761  break;
762  case Format::NV12:
763  os << "NV12";
764  break;
765  case Format::NV21:
766  os << "NV21";
767  break;
768  case Format::IYUV:
769  os << "IYUV";
770  break;
771  case Format::UYVY422:
772  os << "UYVY422";
773  break;
774  default:
775  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
776  }
777 
778  return os;
779 }
780 
781 /** Formatted output of the Format type.
782  *
783  * @param[in] format Type to output.
784  *
785  * @return Formatted string.
786  */
787 inline std::string to_string(const Format &format)
788 {
789  std::stringstream str;
790  str << format;
791  return str.str();
792 }
793 
794 /** Formatted output of the Channel type.
795  *
796  * @param[out] os Output stream.
797  * @param[in] channel Type to output.
798  *
799  * @return Modified output stream.
800  */
801 inline ::std::ostream &operator<<(::std::ostream &os, const Channel &channel)
802 {
803  switch(channel)
804  {
805  case Channel::UNKNOWN:
806  os << "UNKNOWN";
807  break;
808  case Channel::C0:
809  os << "C0";
810  break;
811  case Channel::C1:
812  os << "C1";
813  break;
814  case Channel::C2:
815  os << "C2";
816  break;
817  case Channel::C3:
818  os << "C3";
819  break;
820  case Channel::R:
821  os << "R";
822  break;
823  case Channel::G:
824  os << "G";
825  break;
826  case Channel::B:
827  os << "B";
828  break;
829  case Channel::A:
830  os << "A";
831  break;
832  case Channel::Y:
833  os << "Y";
834  break;
835  case Channel::U:
836  os << "U";
837  break;
838  case Channel::V:
839  os << "V";
840  break;
841  default:
842  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
843  }
844 
845  return os;
846 }
847 
848 /** Formatted output of the Channel type.
849  *
850  * @param[in] channel Type to output.
851  *
852  * @return Formatted string.
853  */
854 inline std::string to_string(const Channel &channel)
855 {
856  std::stringstream str;
857  str << channel;
858  return str.str();
859 }
860 
861 /** Formatted output of the BorderMode type.
862  *
863  * @param[out] os Output stream.
864  * @param[in] mode Type to output.
865  *
866  * @return Modified output stream.
867  */
868 inline ::std::ostream &operator<<(::std::ostream &os, const BorderMode &mode)
869 {
870  switch(mode)
871  {
873  os << "UNDEFINED";
874  break;
876  os << "CONSTANT";
877  break;
879  os << "REPLICATE";
880  break;
881  default:
882  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
883  }
884 
885  return os;
886 }
887 
888 /** Formatted output of the BorderSize type.
889  *
890  * @param[out] os Output stream.
891  * @param[in] border Type to output.
892  *
893  * @return Modified output stream.
894  */
895 inline ::std::ostream &operator<<(::std::ostream &os, const BorderSize &border)
896 {
897  os << border.top << ","
898  << border.right << ","
899  << border.bottom << ","
900  << border.left;
901 
902  return os;
903 }
904 
905 /** Formatted output of the PaddingList type.
906  *
907  * @param[out] os Output stream.
908  * @param[in] padding Type to output.
909  *
910  * @return Modified output stream.
911  */
912 inline ::std::ostream &operator<<(::std::ostream &os, const PaddingList &padding)
913 {
914  os << "{";
915  for(auto const &p : padding)
916  {
917  os << "{" << p.first << "," << p.second << "}";
918  }
919  os << "}";
920  return os;
921 }
922 
923 /** Formatted output of the Multiples type.
924  *
925  * @param[out] os Output stream.
926  * @param[in] multiples Type to output.
927  *
928  * @return Modified output stream.
929  */
930 inline ::std::ostream &operator<<(::std::ostream &os, const Multiples &multiples)
931 {
932  os << "(";
933  for(size_t i = 0; i < multiples.size() - 1; i++)
934  {
935  os << multiples[i] << ", ";
936  }
937  os << multiples.back() << ")";
938  return os;
939 }
940 
941 /** Formatted output of the InterpolationPolicy type.
942  *
943  * @param[out] os Output stream.
944  * @param[in] policy Type to output.
945  *
946  * @return Modified output stream.
947  */
948 inline ::std::ostream &operator<<(::std::ostream &os, const InterpolationPolicy &policy)
949 {
950  switch(policy)
951  {
953  os << "NEAREST_NEIGHBOR";
954  break;
956  os << "BILINEAR";
957  break;
959  os << "AREA";
960  break;
961  default:
962  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
963  }
964 
965  return os;
966 }
967 
968 /** Formatted output of the SamplingPolicy type.
969  *
970  * @param[out] os Output stream.
971  * @param[in] policy Type to output.
972  *
973  * @return Modified output stream.
974  */
975 inline ::std::ostream &operator<<(::std::ostream &os, const SamplingPolicy &policy)
976 {
977  switch(policy)
978  {
980  os << "CENTER";
981  break;
983  os << "TOP_LEFT";
984  break;
985  default:
986  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
987  }
988 
989  return os;
990 }
991 
992 /** Formatted output of the ITensorInfo type.
993  *
994  * @param[out] os Output stream.
995  * @param[in] info Tensor information.
996  *
997  * @return Modified output stream.
998  */
999 inline ::std::ostream &operator<<(std::ostream &os, const ITensorInfo *info)
1000 {
1001  const DataType data_type = info->data_type();
1002  const DataLayout data_layout = info->data_layout();
1003 
1004  os << "Shape=" << info->tensor_shape() << ","
1005  << "DataLayout=" << string_from_data_layout(data_layout) << ","
1006  << "DataType=" << string_from_data_type(data_type) << ",";
1007 
1008  if(is_data_type_quantized(data_type))
1009  {
1010  const QuantizationInfo qinfo = info->quantization_info();
1011  os << "QuantizationInfo=";
1012  if(is_data_type_quantized_per_channel(data_type))
1013  {
1014  os << "[";
1015  const auto scales = qinfo.scale();
1016  const auto offsets = qinfo.offset();
1017  os << "(" << scales[0] << ", " << offsets[0] << ")";
1018  for(size_t i = 1; i < scales.size(); ++i)
1019  {
1020  os << ",(" << scales[i] << ", " << offsets[i] << ")";
1021  }
1022  os << "]";
1023  }
1024  else
1025  {
1026  os << "(" << qinfo.uniform().scale << ", "
1027  << qinfo.uniform().offset << ")";
1028  }
1029  }
1030  return os;
1031 }
1032 
1033 /** Formatted output of the TensorInfo type.
1034  *
1035  * @param[out] os Output stream.
1036  * @param[in] info Type to output.
1037  *
1038  * @return Modified output stream.
1039  */
1040 inline ::std::ostream &operator<<(::std::ostream &os, const TensorInfo &info)
1041 {
1042  os << &info;
1043  return os;
1044 }
1045 
1046 /** Formatted output of the TensorInfo type.
1047  *
1048  * @param[in] info Type to output.
1049  *
1050  * @return Formatted string.
1051  */
1052 inline std::string to_string(const TensorInfo &info)
1053 {
1054  std::stringstream str;
1055  str << &info;
1056  return str.str();
1057 }
1058 
1059 /** Formatted output of the Dimensions type.
1060  *
1061  * @param[in] dimensions Type to output.
1062  *
1063  * @return Formatted string.
1064  */
1065 template <typename T>
1066 inline std::string to_string(const Dimensions<T> &dimensions)
1067 {
1068  std::stringstream str;
1069  str << dimensions;
1070  return str.str();
1071 }
1072 
1073 /** Formatted output of the Strides type.
1074  *
1075  * @param[in] stride Type to output.
1076  *
1077  * @return Formatted string.
1078  */
1079 inline std::string to_string(const Strides &stride)
1080 {
1081  std::stringstream str;
1082  str << stride;
1083  return str.str();
1084 }
1085 
1086 /** Formatted output of the TensorShape type.
1087  *
1088  * @param[in] shape Type to output.
1089  *
1090  * @return Formatted string.
1091  */
1092 inline std::string to_string(const TensorShape &shape)
1093 {
1094  std::stringstream str;
1095  str << shape;
1096  return str.str();
1097 }
1098 
1099 /** Formatted output of the Coordinates type.
1100  *
1101  * @param[in] coord Type to output.
1102  *
1103  * @return Formatted string.
1104  */
1105 inline std::string to_string(const Coordinates &coord)
1106 {
1107  std::stringstream str;
1108  str << coord;
1109  return str.str();
1110 }
1111 
1112 /** Formatted output of the GEMMReshapeInfo type.
1113  *
1114  * @param[out] os Output stream.
1115  * @param[in] info Type to output.
1116  *
1117  * @return Modified output stream.
1118  */
1119 inline ::std::ostream &operator<<(::std::ostream &os, const GEMMReshapeInfo &info)
1120 {
1121  os << "{m=" << info.m() << ",";
1122  os << "n=" << info.n() << ",";
1123  os << "k=" << info.k() << ",";
1124  os << "mult_transpose1xW_width=" << info.mult_transpose1xW_width() << ",";
1125  os << "mult_interleave4x4_height=" << info.mult_interleave4x4_height();
1126  os << "}";
1127 
1128  return os;
1129 }
1130 
1131 /** Formatted output of the GEMMInfo type.
1132  *
1133  * @param[out] os Output stream.
1134  * @param[in] info Type to output.
1135  *
1136  * @return Modified output stream.
1137  */
1138 inline ::std::ostream &operator<<(::std::ostream &os, const GEMMInfo &info)
1139 {
1140  os << "{is_a_reshaped=" << info.is_a_reshaped() << ",";
1141  os << "is_b_reshaped=" << info.is_b_reshaped() << ",";
1142  os << "reshape_b_only_on_first_run=" << info.reshape_b_only_on_first_run() << ",";
1143  os << "depth_output_gemm3d=" << info.depth_output_gemm3d() << ",";
1144  os << "reinterpret_input_as_3d=" << info.reinterpret_input_as_3d() << ",";
1145  os << "retain_internal_weights=" << info.retain_internal_weights() << ",";
1146  os << "fp_mixed_precision=" << info.fp_mixed_precision() << ",";
1147  os << "broadcast_bias=" << info.broadcast_bias() << ",";
1148  os << "pretranpose_B=" << info.pretranpose_B() << ",";
1149 
1150  return os;
1151 }
1152 
1153 /** Formatted output of the Window::Dimension type.
1154  *
1155  * @param[out] os Output stream.
1156  * @param[in] dim Type to output.
1157  *
1158  * @return Modified output stream.
1159  */
1160 inline ::std::ostream &operator<<(::std::ostream &os, const Window::Dimension &dim)
1161 {
1162  os << "{start=" << dim.start() << ", end=" << dim.end() << ", step=" << dim.step() << "}";
1163 
1164  return os;
1165 }
1166 /** Formatted output of the Window type.
1167  *
1168  * @param[out] os Output stream.
1169  * @param[in] win Type to output.
1170  *
1171  * @return Modified output stream.
1172  */
1173 inline ::std::ostream &operator<<(::std::ostream &os, const Window &win)
1174 {
1175  os << "{";
1176  for(unsigned int i = 0; i < Coordinates::num_max_dimensions; i++)
1177  {
1178  if(i > 0)
1179  {
1180  os << ", ";
1181  }
1182  os << win[i];
1183  }
1184  os << "}";
1185 
1186  return os;
1187 }
1188 
1189 /** Formatted output of the WeightsInfo type.
1190  *
1191  * @param[in] info Type to output.
1192  *
1193  * @return Formatted string.
1194  */
1195 inline std::string to_string(const WeightsInfo &info)
1196 {
1197  std::stringstream str;
1198  str << info;
1199  return str.str();
1200 }
1201 
1202 /** Formatted output of the GEMMReshapeInfo type.
1203  *
1204  * @param[in] info Type to output.
1205  *
1206  * @return Formatted string.
1207  */
1208 inline std::string to_string(const GEMMReshapeInfo &info)
1209 {
1210  std::stringstream str;
1211  str << info;
1212  return str.str();
1213 }
1214 
1215 /** Formatted output of the GEMMInfo type.
1216  *
1217  * @param[in] info Type to output.
1218  *
1219  * @return Formatted string.
1220  */
1221 inline std::string to_string(const GEMMInfo &info)
1222 {
1223  std::stringstream str;
1224  str << info;
1225  return str.str();
1226 }
1227 
1228 /** Formatted output of the Window::Dimension type.
1229  *
1230  * @param[in] dim Type to output.
1231  *
1232  * @return Formatted string.
1233  */
1234 inline std::string to_string(const Window::Dimension &dim)
1235 {
1236  std::stringstream str;
1237  str << dim;
1238  return str.str();
1239 }
1240 /** Formatted output of the Window type.
1241  *
1242  * @param[in] win Type to output.
1243  *
1244  * @return Formatted string.
1245  */
1246 inline std::string to_string(const Window &win)
1247 {
1248  std::stringstream str;
1249  str << win;
1250  return str.str();
1251 }
1252 
1253 /** Formatted output of the Rectangle type.
1254  *
1255  * @param[out] os Output stream.
1256  * @param[in] rect Type to output.
1257  *
1258  * @return Modified output stream.
1259  */
1260 inline ::std::ostream &operator<<(::std::ostream &os, const Rectangle &rect)
1261 {
1262  os << rect.width << "x" << rect.height;
1263  os << "+" << rect.x << "+" << rect.y;
1264 
1265  return os;
1266 }
1267 
1268 /** Formatted output of the PaddingMode type.
1269  *
1270  * @param[out] os Output stream.
1271  * @param[in] mode Type to output.
1272  *
1273  * @return Modified output stream.
1274  */
1275 inline ::std::ostream &operator<<(::std::ostream &os, const PaddingMode &mode)
1276 {
1277  switch(mode)
1278  {
1279  case PaddingMode::CONSTANT:
1280  os << "CONSTANT";
1281  break;
1282  case PaddingMode::REFLECT:
1283  os << "REFLECT";
1284  break;
1286  os << "SYMMETRIC";
1287  break;
1288  default:
1289  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1290  }
1291 
1292  return os;
1293 }
1294 
1295 /** Formatted output of the PaddingMode type.
1296  *
1297  * @param[in] mode Type to output.
1298  *
1299  * @return Formatted string.
1300  */
1301 inline std::string to_string(const PaddingMode &mode)
1302 {
1303  std::stringstream str;
1304  str << mode;
1305  return str.str();
1306 }
1307 
1308 /** Formatted output of the PadStrideInfo type.
1309  *
1310  * @param[out] os Output stream.
1311  * @param[in] pad_stride_info Type to output.
1312  *
1313  * @return Modified output stream.
1314  */
1315 inline ::std::ostream &operator<<(::std::ostream &os, const PadStrideInfo &pad_stride_info)
1316 {
1317  os << pad_stride_info.stride().first << "," << pad_stride_info.stride().second;
1318  os << ";";
1319  os << pad_stride_info.pad_left() << "," << pad_stride_info.pad_right() << ","
1320  << pad_stride_info.pad_top() << "," << pad_stride_info.pad_bottom();
1321 
1322  return os;
1323 }
1324 
1325 /** Formatted output of the PadStrideInfo type.
1326  *
1327  * @param[in] pad_stride_info Type to output.
1328  *
1329  * @return Formatted string.
1330  */
1331 inline std::string to_string(const PadStrideInfo &pad_stride_info)
1332 {
1333  std::stringstream str;
1334  str << pad_stride_info;
1335  return str.str();
1336 }
1337 
1338 /** Formatted output of the BorderMode type.
1339  *
1340  * @param[in] mode Type to output.
1341  *
1342  * @return Formatted string.
1343  */
1344 inline std::string to_string(const BorderMode &mode)
1345 {
1346  std::stringstream str;
1347  str << mode;
1348  return str.str();
1349 }
1350 
1351 /** Formatted output of the BorderSize type.
1352  *
1353  * @param[in] border Type to output.
1354  *
1355  * @return Formatted string.
1356  */
1357 inline std::string to_string(const BorderSize &border)
1358 {
1359  std::stringstream str;
1360  str << border;
1361  return str.str();
1362 }
1363 
1364 /** Formatted output of the PaddingList type.
1365  *
1366  * @param[in] padding Type to output.
1367  *
1368  * @return Formatted string.
1369  */
1370 inline std::string to_string(const PaddingList &padding)
1371 {
1372  std::stringstream str;
1373  str << padding;
1374  return str.str();
1375 }
1376 
1377 /** Formatted output of the Multiples type.
1378  *
1379  * @param[in] multiples Type to output.
1380  *
1381  * @return Formatted string.
1382  */
1383 inline std::string to_string(const Multiples &multiples)
1384 {
1385  std::stringstream str;
1386  str << multiples;
1387  return str.str();
1388 }
1389 
1390 /** Formatted output of the InterpolationPolicy type.
1391  *
1392  * @param[in] policy Type to output.
1393  *
1394  * @return Formatted string.
1395  */
1396 inline std::string to_string(const InterpolationPolicy &policy)
1397 {
1398  std::stringstream str;
1399  str << policy;
1400  return str.str();
1401 }
1402 
1403 /** Formatted output of the SamplingPolicy type.
1404  *
1405  * @param[in] policy Type to output.
1406  *
1407  * @return Formatted string.
1408  */
1409 inline std::string to_string(const SamplingPolicy &policy)
1410 {
1411  std::stringstream str;
1412  str << policy;
1413  return str.str();
1414 }
1415 
1416 /** Formatted output of the ConvertPolicy type.
1417  *
1418  * @param[out] os Output stream.
1419  * @param[in] policy Type to output.
1420  *
1421  * @return Modified output stream.
1422  */
1423 inline ::std::ostream &operator<<(::std::ostream &os, const ConvertPolicy &policy)
1424 {
1425  switch(policy)
1426  {
1427  case ConvertPolicy::WRAP:
1428  os << "WRAP";
1429  break;
1431  os << "SATURATE";
1432  break;
1433  default:
1434  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1435  }
1436 
1437  return os;
1438 }
1439 
1440 inline std::string to_string(const ConvertPolicy &policy)
1441 {
1442  std::stringstream str;
1443  str << policy;
1444  return str.str();
1445 }
1446 
1447 /** Formatted output of the ArithmeticOperation type.
1448  *
1449  * @param[out] os Output stream.
1450  * @param[in] op Operation to output.
1451  *
1452  * @return Modified output stream.
1453  */
1454 inline ::std::ostream &operator<<(::std::ostream &os, const ArithmeticOperation &op)
1455 {
1456  switch(op)
1457  {
1459  os << "ADD";
1460  break;
1462  os << "SUB";
1463  break;
1465  os << "DIV";
1466  break;
1468  os << "MAX";
1469  break;
1471  os << "MIN";
1472  break;
1474  os << "SQUARED_DIFF";
1475  break;
1477  os << "POWER";
1478  break;
1479  default:
1480  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1481  }
1482 
1483  return os;
1484 }
1485 
1486 /** Formatted output of the Arithmetic Operation
1487  *
1488  * @param[in] op Type to output.
1489  *
1490  * @return Formatted string.
1491  */
1492 inline std::string to_string(const ArithmeticOperation &op)
1493 {
1494  std::stringstream str;
1495  str << op;
1496  return str.str();
1497 }
1498 
1499 /** Formatted output of the Reduction Operations.
1500  *
1501  * @param[out] os Output stream.
1502  * @param[in] op Type to output.
1503  *
1504  * @return Modified output stream.
1505  */
1506 inline ::std::ostream &operator<<(::std::ostream &os, const ReductionOperation &op)
1507 {
1508  switch(op)
1509  {
1511  os << "SUM";
1512  break;
1514  os << "SUM_SQUARE";
1515  break;
1517  os << "MEAN_SUM";
1518  break;
1520  os << "ARG_IDX_MAX";
1521  break;
1523  os << "ARG_IDX_MIN";
1524  break;
1526  os << "PROD";
1527  break;
1529  os << "MIN";
1530  break;
1532  os << "MAX";
1533  break;
1534  default:
1535  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1536  }
1537 
1538  return os;
1539 }
1540 
1541 /** Formatted output of the Reduction Operations.
1542  *
1543  * @param[in] op Type to output.
1544  *
1545  * @return Formatted string.
1546  */
1547 inline std::string to_string(const ReductionOperation &op)
1548 {
1549  std::stringstream str;
1550  str << op;
1551  return str.str();
1552 }
1553 
1554 /** Formatted output of the Comparison Operations.
1555  *
1556  * @param[out] os Output stream.
1557  * @param[in] op Type to output.
1558  *
1559  * @return Modified output stream.
1560  */
1561 inline ::std::ostream &operator<<(::std::ostream &os, const ComparisonOperation &op)
1562 {
1563  switch(op)
1564  {
1566  os << "Equal";
1567  break;
1569  os << "NotEqual";
1570  break;
1572  os << "Greater";
1573  break;
1575  os << "GreaterEqual";
1576  break;
1578  os << "Less";
1579  break;
1581  os << "LessEqual";
1582  break;
1583  default:
1584  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1585  }
1586 
1587  return os;
1588 }
1589 
1590 /** Formatted output of the Elementwise unary Operations.
1591  *
1592  * @param[out] os Output stream.
1593  * @param[in] op Type to output.
1594  *
1595  * @return Modified output stream.
1596  */
1597 inline ::std::ostream &operator<<(::std::ostream &os, const ElementWiseUnary &op)
1598 {
1599  switch(op)
1600  {
1602  os << "RSQRT";
1603  break;
1604  case ElementWiseUnary::EXP:
1605  os << "EXP";
1606  break;
1607  case ElementWiseUnary::NEG:
1608  os << "NEG";
1609  break;
1610  case ElementWiseUnary::LOG:
1611  os << "LOG";
1612  break;
1614  os << "ROUND";
1615  break;
1616  default:
1617  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1618  }
1619 
1620  return os;
1621 }
1622 
1623 /** Formatted output of the Comparison Operations.
1624  *
1625  * @param[in] op Type to output.
1626  *
1627  * @return Formatted string.
1628  */
1629 inline std::string to_string(const ComparisonOperation &op)
1630 {
1631  std::stringstream str;
1632  str << op;
1633  return str.str();
1634 }
1635 
1636 /** Formatted output of the Elementwise unary Operations.
1637  *
1638  * @param[in] op Type to output.
1639  *
1640  * @return Formatted string.
1641  */
1642 inline std::string to_string(const ElementWiseUnary &op)
1643 {
1644  std::stringstream str;
1645  str << op;
1646  return str.str();
1647 }
1648 
1649 /** Formatted output of the Norm Type.
1650  *
1651  * @param[in] type Type to output.
1652  *
1653  * @return Formatted string.
1654  */
1655 inline std::string to_string(const NormType &type)
1656 {
1657  std::stringstream str;
1658  str << type;
1659  return str.str();
1660 }
1661 
1662 /** Formatted output of the Pooling Type.
1663  *
1664  * @param[in] type Type to output.
1665  *
1666  * @return Formatted string.
1667  */
1668 inline std::string to_string(const PoolingType &type)
1669 {
1670  std::stringstream str;
1671  str << type;
1672  return str.str();
1673 }
1674 
1675 /** Formatted output of the Pooling Layer Info.
1676  *
1677  * @param[in] info Type to output.
1678  *
1679  * @return Formatted string.
1680  */
1681 inline std::string to_string(const PoolingLayerInfo &info)
1682 {
1683  std::stringstream str;
1684  str << "{Type=" << info.pool_type << ","
1685  << "DataLayout=" << info.data_layout << ","
1686  << "IsGlobalPooling=" << info.is_global_pooling;
1687  if(!info.is_global_pooling)
1688  {
1689  str << ","
1690  << "PoolSize=" << info.pool_size.width << "," << info.pool_size.height << ","
1691  << "PadStride=" << info.pad_stride_info;
1692  }
1693  str << "}";
1694  return str.str();
1695 }
1696 
1697 /** Formatted output of the PriorBoxLayerInfo.
1698  *
1699  * @param[in] info Type to output.
1700  *
1701  * @return Formatted string.
1702  */
1703 inline std::string to_string(const PriorBoxLayerInfo &info)
1704 {
1705  std::stringstream str;
1706  str << "{";
1707  str << "Clip:" << info.clip()
1708  << "Flip:" << info.flip()
1709  << "StepX:" << info.steps()[0]
1710  << "StepY:" << info.steps()[1]
1711  << "MinSizes:" << info.min_sizes().size()
1712  << "MaxSizes:" << info.max_sizes().size()
1713  << "ImgSizeX:" << info.img_size().x
1714  << "ImgSizeY:" << info.img_size().y
1715  << "Offset:" << info.offset()
1716  << "Variances:" << info.variances().size();
1717  str << "}";
1718  return str.str();
1719 }
1720 
1721 /** Formatted output of the Size2D type.
1722  *
1723  * @param[out] os Output stream
1724  * @param[in] size Type to output
1725  *
1726  * @return Modified output stream.
1727  */
1728 inline ::std::ostream &operator<<(::std::ostream &os, const Size2D &size)
1729 {
1730  os << size.width << "x" << size.height;
1731 
1732  return os;
1733 }
1734 
1735 /** Formatted output of the Size2D type.
1736  *
1737  * @param[in] type Type to output
1738  *
1739  * @return Formatted string.
1740  */
1741 inline std::string to_string(const Size2D &type)
1742 {
1743  std::stringstream str;
1744  str << type;
1745  return str.str();
1746 }
1747 
1748 /** Formatted output of the ConvolutionMethod type.
1749  *
1750  * @param[out] os Output stream
1751  * @param[in] conv_method Type to output
1752  *
1753  * @return Modified output stream.
1754  */
1755 inline ::std::ostream &operator<<(::std::ostream &os, const ConvolutionMethod &conv_method)
1756 {
1757  switch(conv_method)
1758  {
1760  os << "GEMM";
1761  break;
1763  os << "DIRECT";
1764  break;
1766  os << "WINOGRAD";
1767  break;
1768  default:
1769  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1770  }
1771 
1772  return os;
1773 }
1774 
1775 /** Formatted output of the ConvolutionMethod type.
1776  *
1777  * @param[in] conv_method Type to output
1778  *
1779  * @return Formatted string.
1780  */
1781 inline std::string to_string(const ConvolutionMethod &conv_method)
1782 {
1783  std::stringstream str;
1784  str << conv_method;
1785  return str.str();
1786 }
1787 
1788 /** Formatted output of the GPUTarget type.
1789  *
1790  * @param[out] os Output stream
1791  * @param[in] gpu_target Type to output
1792  *
1793  * @return Modified output stream.
1794  */
1795 inline ::std::ostream &operator<<(::std::ostream &os, const GPUTarget &gpu_target)
1796 {
1797  switch(gpu_target)
1798  {
1800  os << "GPU_ARCH_MASK";
1801  break;
1802  case GPUTarget::MIDGARD:
1803  os << "MIDGARD";
1804  break;
1805  case GPUTarget::BIFROST:
1806  os << "BIFROST";
1807  break;
1808  case GPUTarget::VALHALL:
1809  os << "VALHALL";
1810  break;
1811  case GPUTarget::T600:
1812  os << "T600";
1813  break;
1814  case GPUTarget::T700:
1815  os << "T700";
1816  break;
1817  case GPUTarget::T800:
1818  os << "T800";
1819  break;
1820  case GPUTarget::G71:
1821  os << "G71";
1822  break;
1823  case GPUTarget::G72:
1824  os << "G72";
1825  break;
1826  case GPUTarget::G51:
1827  os << "G51";
1828  break;
1829  case GPUTarget::G51BIG:
1830  os << "G51BIG";
1831  break;
1832  case GPUTarget::G51LIT:
1833  os << "G51LIT";
1834  break;
1835  case GPUTarget::G76:
1836  os << "G76";
1837  break;
1838  case GPUTarget::G77:
1839  os << "G77";
1840  break;
1841  case GPUTarget::G78:
1842  os << "G78";
1843  break;
1844  case GPUTarget::G31:
1845  os << "G31";
1846  break;
1847  case GPUTarget::TODX:
1848  os << "TODX";
1849  break;
1850  default:
1851  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1852  }
1853 
1854  return os;
1855 }
1856 
1857 /** Formatted output of the GPUTarget type.
1858  *
1859  * @param[in] gpu_target Type to output
1860  *
1861  * @return Formatted string.
1862  */
1863 inline std::string to_string(const GPUTarget &gpu_target)
1864 {
1865  std::stringstream str;
1866  str << gpu_target;
1867  return str.str();
1868 }
1869 
1870 /** Formatted output of the DetectionWindow type.
1871  *
1872  * @param[out] os Output stream
1873  * @param[in] detection_window Type to output
1874  *
1875  * @return Modified output stream.
1876  */
1877 inline ::std::ostream &operator<<(::std::ostream &os, const DetectionWindow &detection_window)
1878 {
1879  os << "{x=" << detection_window.x << ","
1880  << "y=" << detection_window.y << ","
1881  << "width=" << detection_window.width << ","
1882  << "height=" << detection_window.height << ","
1883  << "idx_class=" << detection_window.idx_class << ","
1884  << "score=" << detection_window.score << "}";
1885 
1886  return os;
1887 }
1888 
1889 /** Formatted output of the DetectionOutputLayerCodeType type.
1890  *
1891  * @param[out] os Output stream
1892  * @param[in] detection_code Type to output
1893  *
1894  * @return Modified output stream.
1895  */
1896 inline ::std::ostream &operator<<(::std::ostream &os, const DetectionOutputLayerCodeType &detection_code)
1897 {
1898  switch(detection_code)
1899  {
1901  os << "CENTER_SIZE";
1902  break;
1904  os << "CORNER";
1905  break;
1907  os << "CORNER_SIZE";
1908  break;
1910  os << "TF_CENTER";
1911  break;
1912  default:
1913  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1914  }
1915 
1916  return os;
1917 }
1918 /** Formatted output of the DetectionOutputLayerCodeType type.
1919  *
1920  * @param[in] detection_code Type to output
1921  *
1922  * @return Formatted string.
1923  */
1924 inline std::string to_string(const DetectionOutputLayerCodeType &detection_code)
1925 {
1926  std::stringstream str;
1927  str << detection_code;
1928  return str.str();
1929 }
1930 
1931 /** Formatted output of the DetectionOutputLayerInfo type.
1932  *
1933  * @param[out] os Output stream
1934  * @param[in] detection_info Type to output
1935  *
1936  * @return Modified output stream.
1937  */
1938 inline ::std::ostream &operator<<(::std::ostream &os, const DetectionOutputLayerInfo &detection_info)
1939 {
1940  os << "{Classes=" << detection_info.num_classes() << ","
1941  << "ShareLocation=" << detection_info.share_location() << ","
1942  << "CodeType=" << detection_info.code_type() << ","
1943  << "VarianceEncodedInTarget=" << detection_info.variance_encoded_in_target() << ","
1944  << "KeepTopK=" << detection_info.keep_top_k() << ","
1945  << "NMSThreshold=" << detection_info.nms_threshold() << ","
1946  << "Eta=" << detection_info.eta() << ","
1947  << "BackgroundLabelId=" << detection_info.background_label_id() << ","
1948  << "ConfidenceThreshold=" << detection_info.confidence_threshold() << ","
1949  << "TopK=" << detection_info.top_k() << ","
1950  << "NumLocClasses=" << detection_info.num_loc_classes()
1951  << "}";
1952 
1953  return os;
1954 }
1955 
1956 /** Formatted output of the DetectionOutputLayerInfo type.
1957  *
1958  * @param[in] detection_info Type to output
1959  *
1960  * @return Formatted string.
1961  */
1962 inline std::string to_string(const DetectionOutputLayerInfo &detection_info)
1963 {
1964  std::stringstream str;
1965  str << detection_info;
1966  return str.str();
1967 }
1968 /** Formatted output of the DetectionPostProcessLayerInfo type.
1969  *
1970  * @param[out] os Output stream
1971  * @param[in] detection_info Type to output
1972  *
1973  * @return Modified output stream.
1974  */
1975 inline ::std::ostream &operator<<(::std::ostream &os, const DetectionPostProcessLayerInfo &detection_info)
1976 {
1977  os << "{MaxDetections=" << detection_info.max_detections() << ","
1978  << "MaxClassesPerDetection=" << detection_info.max_classes_per_detection() << ","
1979  << "NmsScoreThreshold=" << detection_info.nms_score_threshold() << ","
1980  << "NmsIouThreshold=" << detection_info.iou_threshold() << ","
1981  << "NumClasses=" << detection_info.num_classes() << ","
1982  << "ScaleValue_y=" << detection_info.scale_value_y() << ","
1983  << "ScaleValue_x=" << detection_info.scale_value_x() << ","
1984  << "ScaleValue_h=" << detection_info.scale_value_h() << ","
1985  << "ScaleValue_w=" << detection_info.scale_value_w() << ","
1986  << "UseRegularNms=" << detection_info.use_regular_nms() << ","
1987  << "DetectionPerClass=" << detection_info.detection_per_class()
1988  << "}";
1989 
1990  return os;
1991 }
1992 
1993 /** Formatted output of the DetectionPostProcessLayerInfo type.
1994  *
1995  * @param[in] detection_info Type to output
1996  *
1997  * @return Formatted string.
1998  */
1999 inline std::string to_string(const DetectionPostProcessLayerInfo &detection_info)
2000 {
2001  std::stringstream str;
2002  str << detection_info;
2003  return str.str();
2004 }
2005 
2006 /** Formatted output of the DetectionWindow type.
2007  *
2008  * @param[in] detection_window Type to output
2009  *
2010  * @return Formatted string.
2011  */
2012 inline std::string to_string(const DetectionWindow &detection_window)
2013 {
2014  std::stringstream str;
2015  str << detection_window;
2016  return str.str();
2017 }
2018 
2019 /** Formatted output of a vector of objects.
2020  *
2021  * @param[out] os Output stream
2022  * @param[in] args Vector of objects to print
2023  *
2024  * @return Modified output stream.
2025  */
2026 template <typename T>
2027 inline ::std::ostream &operator<<(::std::ostream &os, const std::vector<T> &args)
2028 {
2029  os << "[";
2030  bool first = true;
2031  for(auto &arg : args)
2032  {
2033  if(first)
2034  {
2035  first = false;
2036  }
2037  else
2038  {
2039  os << ", ";
2040  }
2041  os << arg;
2042  }
2043  os << "]";
2044  return os;
2045 }
2046 
2047 /** Formatted output of @ref PriorBoxLayerInfo.
2048  *
2049  * @param[out] os Output stream.
2050  * @param[in] info Type to output.
2051  *
2052  * @return Modified output stream.
2053  */
2054 inline ::std::ostream &operator<<(::std::ostream &os, const PriorBoxLayerInfo &info)
2055 {
2056  os << "Clip:" << info.clip()
2057  << "Flip:" << info.flip()
2058  << "StepX:" << info.steps()[0]
2059  << "StepY:" << info.steps()[1]
2060  << "MinSizes:" << info.min_sizes()
2061  << "MaxSizes:" << info.max_sizes()
2062  << "ImgSizeX:" << info.img_size().x
2063  << "ImgSizeY:" << info.img_size().y
2064  << "Offset:" << info.offset()
2065  << "Variances:" << info.variances();
2066 
2067  return os;
2068 }
2069 
2070 /** Formatted output of a vector of objects.
2071  *
2072  * @param[in] args Vector of objects to print
2073  *
2074  * @return String representing args.
2075  */
2076 template <typename T>
2077 std::string to_string(const std::vector<T> &args)
2078 {
2079  std::stringstream str;
2080  str << args;
2081  return str.str();
2082 }
2083 
2084 /** Formatted output of the WinogradInfo type. */
2085 inline ::std::ostream &operator<<(::std::ostream &os, const WinogradInfo &info)
2086 {
2087  os << "{OutputTileSize=" << info.output_tile_size << ","
2088  << "KernelSize=" << info.kernel_size << ","
2089  << "PadStride=" << info.convolution_info << ","
2090  << "OutputDataLayout=" << info.output_data_layout << "}";
2091 
2092  return os;
2093 }
2094 
2095 inline std::string to_string(const WinogradInfo &type)
2096 {
2097  std::stringstream str;
2098  str << type;
2099  return str.str();
2100 }
2101 
2102 /** Fallback method: try to use std::to_string:
2103  *
2104  * @param[in] val Value to convert to string
2105  *
2106  * @return String representing val.
2107  */
2108 template <typename T>
2109 inline std::string to_string(const T &val)
2110 {
2111  return support::cpp11::to_string(val);
2112 }
2113 
2114 /** Convert a CLTunerMode value to a string
2115  *
2116  * @param val CLTunerMode value to be converted
2117  *
2118  * @return String representing the corresponding CLTunerMode.
2119  */
2120 inline std::string to_string(const CLTunerMode val)
2121 {
2122  switch(val)
2123  {
2125  {
2126  return std::string("Exhaustive");
2127  }
2128  case CLTunerMode::NORMAL:
2129  {
2130  return std::string("Normal");
2131  }
2132  case CLTunerMode::RAPID:
2133  {
2134  return std::string("Rapid");
2135  }
2136  default:
2137  {
2138  ARM_COMPUTE_ERROR("Invalid tuner mode.");
2139  return std::string("UNDEFINED");
2140  }
2141  }
2142 }
2143 /** Converts a @ref CLGEMMKernelType to string
2144  *
2145  * @param[in] val CLGEMMKernelType value to be converted
2146  *
2147  * @return String representing the corresponding CLGEMMKernelType
2148  */
2149 inline std::string to_string(CLGEMMKernelType val)
2150 {
2151  switch(val)
2152  {
2154  {
2155  return "Native_V1";
2156  }
2158  {
2159  return "Reshaped_V1";
2160  }
2162  {
2163  return "Native";
2164  }
2166  {
2167  return "Reshaped_Only_RHS";
2168  }
2170  {
2171  return "Reshaped";
2172  }
2173  default:
2174  {
2175  return "Unknown";
2176  }
2177  }
2178 }
2179 /** [Print CLTunerMode type] **/
2180 /** Formatted output of the CLTunerMode type.
2181  *
2182  * @param[out] os Output stream.
2183  * @param[in] val CLTunerMode to output.
2184  *
2185  * @return Modified output stream.
2186  */
2187 inline ::std::ostream &operator<<(::std::ostream &os, const CLTunerMode &val)
2188 {
2189  os << to_string(val);
2190  return os;
2191 }
2192 
2193 } // namespace arm_compute
2194 
2195 #endif /* __ARM_COMPUTE_TYPE_PRINTER_H__ */
BorderMode
Methods available to handle borders.
Definition: Types.h:256
Rectangle type.
Definition: Types.h:404
bool is_data_type_quantized(DataType dt)
Check if a given data type is of quantized type.
Definition: Utils.h:981
const std::vector< int32_t > & offset() const
Offset vector accessor.
unsigned int top
top of the border
Definition: Types.h:372
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:467
InterpolationPolicy
Interpolation method.
Definition: Types.h:389
int num_classes() const
Get num classes.
Definition: Types.h:950
int mult_interleave4x4_height() const
Multiplication factor for the height of the 4x4 interleaved block.
Definition: Types.h:1822
int mult_interleave4x4_height
Multiplication factor for the height of the 4x4 interleaved block.
Generate Proposals Information class.
Definition: Types.h:1277
Second channel (used by formats with unknown channel types).
Shape of a tensor.
Definition: TensorShape.h:39
bool share_location() const
Get share location.
Definition: Types.h:955
float scale_value_x() const
Get x scale value.
Definition: Types.h:1103
DataLayout output_data_layout
Data layout to use for the output tensor once the convolution has been applied (NCHW or NHWC) ...
Definition: Types.h:2161
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.
Descriptor used by the GEMM kernels.
uint16_t x
Top-left x coordinate.
Definition: Types.h:517
float score
Confidence value for the detection window.
Definition: Types.h:522
bool enabled() const
Check if initialised.
Definition: Types.h:1525
std::vector< PaddingInfo > PaddingList
List of padding information.
Definition: Types.h:431
ReductionOperation
Available reduction operations.
Definition: Types.h:454
Container for 2D border size.
Definition: Types.h:264
unsigned int max_detections() const
Get max detections.
Definition: Types.h:1062
Cr/V/Value channel.
unsigned int v0
Number of vertical blocks of size (m0xk0) stored on the same output row.
Definition: Types.h:1913
#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:120
Winograd information.
Definition: Types.h:2142
uint32_t norm_size() const
Get the normalization size.
Definition: Types.h:1599
1 channel, 1 U8 per channel
NormType type() const
Get the normalization type.
Definition: Types.h:1594
int mult_transpose1xW_width() const
Multiplication factor for the width of the 1xW transposed block.
Definition: Types.h:1814
GEMM reshape information class.
Definition: Types.h:1760
PadStrideInfo convolution_info
Convolution info (Pads, strides,...)
Definition: Types.h:2160
std::string to_string(T &&value)
Convert integer and float values to string.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
bool are_reshaped() const
Flag which specifies if the weights tensor has been reshaped.
Definition: Types.h:1718
1 channel, 1 F32 per channel
Searches a subset of LWS configurations while tuning.
Normalization Layer Information class.
Definition: Types.h:1576
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:1928
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:2064
GEMM LHS (Left Hand Side) matrix information.
Definition: Types.h:1904
Store the tensor&#39;s metadata.
Definition: ITensorInfo.h:40
bool pretranpose_B() const
Flag which specifies whether b should be pre-transposed if supported.
Definition: Types.h:2088
A 2 plane YUV format of Luma (Y) and interleaved UV data at 4:2:0 sampling.
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:374
Reshaped GEMM kernel where only the rhs matrix is reshaped.
float eta() const
Get eta.
Definition: Types.h:980
int depth_output_gemm3d() const
Depth of the output when GEMM output is reinterpreted as 3D tensor.
Definition: Types.h:2024
unsigned int pooled_width() const
Get the pooled width of the layer.
Definition: Types.h:1249
unsigned int pad_top() const
Get the top padding.
Definition: Types.h:731
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:2040
CLGEMMKernelType
OpenCL GEMM kernel types.
Definition: CLTypes.h:31
DetectionOutputLayerCodeType
Available Detection Output code types.
Definition: Types.h:892
ConvolutionMethod
Available ConvolutionMethod.
Definition: Types.h:129
Reshaped GEMM kernel where both lhs and rhs matrices are reshaped.
Activation Layer Information class.
Definition: Types.h:1475
decltype(strategy::transforms) typedef type
float spatial_scale() const
Definition: Types.h:1389
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:1092
bool transpose
True if the (k0xn0) block has to be transposed before been stored.
Definition: Types.h:1929
bool interleave
True if the v0 (m0xk0) blocks have to be interleaved in the output row.
Definition: Types.h:1915
bool export_to_cl_image
True if the reshaped rhs has to be exported to cl_image.
Definition: Types.h:1931
int top_k() const
Get top K.
Definition: Types.h:995
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:2006
int32_t x
X coordinates.
Definition: Types.h:415
ActivationFunction
Available activation functions.
Definition: Types.h:1479
1 channel, 1 F16 per channel
Samples are taken at pixel center.
float iou_threshold() const
Get intersection over union threshold.
Definition: Types.h:1082
Convolution Layer Weights Information class.
Definition: Types.h:1694
1 channel, 1 S32 per channel
bool variance_encoded_in_target() const
Get if variance encoded in target.
Definition: Types.h:965
16-bit brain floating-point number
bool transpose
True if the (m0xk0) block has to be transposed before been stored.
Definition: Types.h:1914
signed 64-bit number
int n() const
Number of matrix B columns.
Definition: Types.h:1798
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:1927
unsigned int m
Number of LHS rows.
Quantization information.
std::string to_string(const ROIPoolingLayerInfo &pool_info)
Formatted output of the ROIPoolingInfo type.
Definition: TypePrinter.h:148
unsigned int n
Number of RHS columns.
const std::string & string_from_data_type(DataType dt)
Convert a data type identity into a string.
Definition: Utils.cpp:135
int32_t y
Y coordinates.
Definition: Types.h:416
std::array< float, 2 > steps() const
Get the step coordinates.
Definition: Types.h:839
float nms_threshold() const
Get nms threshold.
Definition: Types.h:975
Third channel (used by formats with unknown channel types).
1 channel, 1 U32 per channel
bool is_data_type_quantized_per_channel(DataType dt)
Check if a given data type is of per channel type.
Definition: Utils.h:1058
GEMM RHS (Right Hand Side) matrix information.
Definition: Types.h:1919
int32_t b_offset
Offset to be added to each element of the matrix B.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
Normalization applied within the same map in 1D region.
Size2D output_tile_size
Width and height of the output tile.
Definition: Types.h:2157
Channel
Available channels.
Definition: Types.h:437
Format
Image colour formats.
Definition: Types.h:54
PaddingMode
Padding mode to use for PadLayer.
Definition: Types.h:160
uint16_t width
Width of the detection window.
Definition: Types.h:519
unsigned int n0
Number of columns processed by the matrix multiplication.
Definition: Types.h:1926
quantized, asymmetric fixed-point 8-bit number unsigned
Coordinates of an item.
Definition: Coordinates.h:37
float scale_value_h() const
Get h scale value.
Definition: Types.h:1109
std::pair< unsigned int, unsigned int > stride() const
Get the stride.
Definition: Types.h:695
float scale_value_w() const
Get w scale value.
Definition: Types.h:1115
Pooling Layer Information struct.
Definition: Types.h:1139
UniformQuantizationInfo uniform() const
Return per layer quantization info.
float nms_score_threshold() const
Get nms threshold.
Definition: Types.h:1077
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:764
float offset() const
Get the offset.
Definition: Types.h:849
Fourth channel (used by formats with unknown channel types).
DetectionOutputLayerCodeType code_type() const
Get detection output code type.
Definition: Types.h:960
unsigned int pad_right() const
Get the right padding.
Definition: Types.h:726
const std::vector< float > & scale() const
Scale vector accessor.
int k() const
Number of matrix A columns or matrix B rows.
Definition: Types.h:1806
Padding and stride information class.
Definition: Types.h:647
ComparisonOperation
Supported comparison operations.
Definition: Types.h:168
Coordinates2D img_size() const
Get the image size coordinates.
Definition: Types.h:844
unsigned int num_kernels() const
Return the number of convolution kernels.
Definition: Types.h:1726
bool reinterpret_input_as_3d() const
Flag which specifies if the input tensor has to be reinterpreted as 3D.
Definition: Types.h:2032
Bounding Box Transform information class.
Definition: Types.h:1408
unsigned int left
left of the border
Definition: Types.h:375
virtual QuantizationInfo quantization_info() const =0
Get the quantization settings (scale and offset) of the tensor.
unsigned int right
right of the border
Definition: Types.h:373
1 channel, 1 S16 per channel
bool broadcast_bias() const
Flag which specifies whether to broadcast the shape of the bias tensor.
Definition: Types.h:2080
uint16_t idx_class
Index of the class.
Definition: Types.h:521
int keep_top_k() const
Get the number of total bounding boxes to be kept per image.
Definition: Types.h:970
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:1067
bool is_a_reshaped() const
Flag which specifies if the matrix A has been reshaped.
Definition: Types.h:1998
float scale_value_y() const
Get y scale value.
Definition: Types.h:1097
uint16_t height
Height of the detection window.
Definition: Types.h:520
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:901
4 channels, 1 U8 per channel
PoolingType
Available pooling types.
Definition: Types.h:535
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
Rounds to nearest value; half rounds to nearest even.
const std::string & string_from_data_layout(DataLayout dl)
Convert a data layout identity into a string.
Definition: Utils.cpp:123
PadStrideInfo pad_stride_info
Definition: Types.h:1227
size_t width
Width of the image region or rectangle.
Definition: Size2D.h:89
GPUTarget
Available GPU Targets.
Definition: GPUTarget.h:34
unsigned int pooled_height() const
Get the pooled height of the layer.
Definition: Types.h:1254
int m() const
Number of matrix A rows.
Definition: Types.h:1790
Borders are left undefined.
ROI Pooling Layer Information class.
Definition: Types.h:1234
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:515
const QuantizationInfo qinfo
Definition: Im2Col.cpp:155
std::vector< float > max_sizes() const
Get max sizes.
Definition: Types.h:864
ComputeAnchors information class.
Definition: Types.h:1358
CLTunerMode
< OpenCL tuner modes
Definition: CLTunerTypes.h:35
uint16_t width
Width of the rectangle.
Definition: Types.h:408
Num samples, height, width, channels.
unsigned int detection_per_class() const
Get detection per class.
Definition: Types.h:1072
bool flip() const
Get the flip value.
Definition: Types.h:854
2 channel, 1 U8 per channel
uint16_t y
Top-left y coordinate.
Definition: Types.h:518
unsigned int k
Number of LHS columns or RHS rows.
float spatial_scale() const
Get the spatial scale.
Definition: Types.h:1259
uint16_t y
Top-left y coordinate.
Definition: Types.h:407
Detection Output layer info.
Definition: Types.h:1020
bool interleave
True if the h0 (k0xn0) blocks have to be interleaved in the output row.
Definition: Types.h:1930
unsigned int num_classes() const
Get num classes.
Definition: Types.h:1087
Use box centers and size but flip x and y co-ordinates.
std::vector< float > variances() const
Get min variances.
Definition: Types.h:834
Size2D kernel_size
Width and height of the kernel.
Definition: Types.h:2158
std::array< float, 4 > weights() const
Definition: Types.h:1429
Store the tensor&#39;s metadata.
Definition: TensorInfo.h:43
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:2016
unsigned int k0
Number of partial accumulations performed by the matrix multiplication.
Definition: Types.h:1912
uint16_t x
Top-left x coordinate.
Definition: Types.h:406
GEMM information class.
Definition: Types.h:1939
unsigned int m0
Number of rows processed by the matrix multiplication.
Definition: Types.h:1911
ActivationFunction activation() const
Get the type of activation function.
Definition: Types.h:1510
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
int mult_transpose1xW_width
Multiplication factor for the width of the 1xW transposed block.
uint16_t height
Height of the rectangle.
Definition: Types.h:409
unsigned int pad_bottom() const
Get the bottom padding.
Definition: Types.h:736
A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes.
bool clip() const
Get the clip value.
Definition: Types.h:859
static constexpr size_t num_max_dimensions
Number of dimensions the tensor has.
Definition: Dimensions.h:46
unsigned 64-bit number
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:721
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:480
DataLayout
[DataLayout enum definition]
Definition: Types.h:111
std::vector< uint32_t > Multiples
Information to produce a tiled version of a Tensor.
Definition: Types.h:434
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:502
signed 8-bit number
Normalization applied cross maps.
Convolution using GEMM.
Describe a multidimensional execution window.
Definition: Window.h:39
ConvertPolicy
Policy to handle overflow.
Definition: Types.h:382
int background_label_id() const
Get background label ID.
Definition: Types.h:985
float confidence_threshold() const
Get confidence threshold.
Definition: Types.h:990
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:1734
int num_loc_classes() const
Get number of location classes.
Definition: Types.h:1000
inline ::std::ostream & operator<<(::std::ostream &os, const Dimensions< T > &dimensions)
Formatted output of the Dimensions type.
Definition: TypePrinter.h:72
std::string to_string_if_not_null(T *arg)
Formatted output if arg is not null.
Definition: TypePrinter.h:52
virtual DataLayout data_layout() const =0
Get the data layout of the tensor.
std::vector< float > min_sizes() const
Get min sizes.
Definition: Types.h:829