Compute Library
 22.08
TypePrinter.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2022 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 
27 #ifdef ARM_COMPUTE_OPENCL_ENABLED
29 #endif /* ARM_COMPUTE_OPENCL_ENABLED */
30 
32 #include "arm_compute/core/Error.h"
38 #include "arm_compute/core/Types.h"
45 #include "support/Cast.h"
46 #include "support/StringSupport.h"
47 #include <ostream>
48 #include <sstream>
49 #include <string>
50 
51 namespace arm_compute
52 {
53 /** Formatted output if arg is not null
54  *
55  * @param[in] arg Object to print
56  *
57  * @return String representing arg.
58  */
59 template <typename T>
60 std::string to_string_if_not_null(T *arg)
61 {
62  if(arg == nullptr)
63  {
64  return "nullptr";
65  }
66  else
67  {
68  return to_string(*arg);
69  }
70 }
71 
72 /** Fallback method: try to use std::to_string:
73  *
74  * @param[in] val Value to convert to string
75  *
76  * @return String representing val.
77  */
78 template <typename T>
79 inline std::string to_string(const T &val)
80 {
81  return support::cpp11::to_string(val);
82 }
83 
84 /** Formatted output of a vector of objects.
85  *
86  * @note: Using the overloaded to_string() instead of overloaded operator<<(), because to_string() functions are
87  * overloaded for all types, where two or more of them can use the same operator<<(), ITensor is an example.
88  *
89  * @param[out] os Output stream
90  * @param[in] args Vector of objects to print
91  *
92  * @return Modified output stream.
93  */
94 template <typename T>
95 ::std::ostream &operator<<(::std::ostream &os, const std::vector<T> &args)
96 {
97  const size_t max_print_size = 5U;
98 
99  os << "[";
100  bool first = true;
101  size_t i;
102  for(i = 0; i < args.size(); ++i)
103  {
104  if(i == max_print_size)
105  {
106  break;
107  }
108  if(first)
109  {
110  first = false;
111  }
112  else
113  {
114  os << ", ";
115  }
116  os << to_string(args[i]);
117  }
118  if(i < args.size())
119  {
120  os << ", ...";
121  }
122  os << "]";
123  return os;
124 }
125 
126 /** Formatted output of a vector of objects.
127  *
128  * @param[in] args Vector of objects to print
129  *
130  * @return String representing args.
131  */
132 template <typename T>
133 std::string to_string(const std::vector<T> &args)
134 {
135  std::stringstream str;
136  str << args;
137  return str.str();
138 }
139 
140 /** @name (EXPERIMENTAL_POST_OPS)
141  * @{
142  */
143 /** Formmated output of the @ref experimental::PostOpType type
144  *
145  * @param[out] os Output stream.
146  * @param[in] post_op_type Type to output.
147  *
148  * @return Modified output stream.
149  */
150 inline ::std::ostream &operator<<(::std::ostream &os, experimental::PostOpType post_op_type)
151 {
152  os << "type=";
153  switch(post_op_type)
154  {
156  {
157  os << "Activation";
158  break;
159  }
161  {
162  os << "Eltwise_Add";
163  break;
164  }
166  {
167  os << "Eltwise_PRelu";
168  break;
169  }
170  default:
171  {
172  ARM_COMPUTE_ERROR("Unsupported PostOpType");
173  break;
174  }
175  }
176  return os;
177 }
178 /** Converts a @ref experimental::PostOpType to string
179  *
180  * @param[in] post_op_type PostOpType value to be converted
181  *
182  * @return String representing the corresponding PostOpType
183  */
184 inline std::string to_string(experimental::PostOpType post_op_type)
185 {
186  std::stringstream str;
187  str << post_op_type;
188  return str.str();
189 }
190 /** Formatted output of the @ref experimental::IPostOp type.
191  *
192  * @param[out] os Output stream.
193  * @param[in] post_op Type to output.
194  *
195  * @return Modified output stream.
196  */
197 template <typename T>
198 inline ::std::ostream &operator<<(::std::ostream &os, const experimental::IPostOp<T> &post_op)
199 {
200  os << "<";
201  os << post_op.type() << ",";
202  os << "prev_dst_pos=" << post_op.prev_dst_pos() << ",";
203  switch(post_op.type())
204  {
206  {
207  const auto _post_op = utils::cast::polymorphic_downcast<const experimental::PostOpAct<T> *>(&post_op);
208  os << "act_info=" << &(_post_op->_act_info);
209  break;
210  }
212  {
213  const auto _post_op = utils::cast::polymorphic_downcast<const experimental::PostOpEltwiseAdd<T> *>(&post_op);
214  os << "convert_policy=" << _post_op->_policy;
215  break;
216  }
218  {
219  const auto _post_op = utils::cast::polymorphic_downcast<const experimental::PostOpEltwisePRelu<T> *>(&post_op);
220  os << "convert_policy=" << _post_op->_policy;
221  break;
222  }
223  default:
224  {
225  ARM_COMPUTE_ERROR("Unsupported PostOpType");
226  break;
227  }
228  }
229  os << ">";
230  return os;
231 }
232 /** Converts an @ref experimental::IPostOp to string
233  *
234  * @param[in] post_op IPostOp value to be converted
235  *
236  * @return String representing the corresponding IPostOp
237  */
238 template <typename T>
239 inline std::string to_string(const experimental::IPostOp<T> &post_op)
240 {
241  std::stringstream str;
242  str << post_op;
243  return str.str();
244 }
245 /** Formatted output of the @ref experimental::PostOpList type.
246  *
247  * @param[out] os Output stream.
248  * @param[in] post_ops Type to output.
249  *
250  * @return Modified output stream.
251  */
252 template <typename T>
253 inline ::std::ostream &operator<<(::std::ostream &os, const experimental::PostOpList<T> &post_ops)
254 {
255  os << "[";
256  for(const auto &post_op : post_ops.get_list())
257  {
258  os << *post_op << ",";
259  }
260  os << "]";
261  return os;
262 }
263 /** Converts a @ref experimental::PostOpList to string
264  *
265  * @param[in] post_ops PostOpList value to be converted
266  *
267  * @return String representing the corresponding PostOpList
268  */
269 template <typename T>
271 {
272  std::stringstream str;
273  str << post_ops;
274  return str.str();
275 }
276 /** @} */ // end of group (EXPERIMENTAL_POST_OPS)
277 
278 /** Formatted output of the Dimensions type.
279  *
280  * @param[out] os Output stream.
281  * @param[in] dimensions Type to output.
282  *
283  * @return Modified output stream.
284  */
285 template <typename T>
286 inline ::std::ostream &operator<<(::std::ostream &os, const Dimensions<T> &dimensions)
287 {
288  if(dimensions.num_dimensions() > 0)
289  {
290  os << dimensions[0];
291 
292  for(unsigned int d = 1; d < dimensions.num_dimensions(); ++d)
293  {
294  os << "," << dimensions[d];
295  }
296  }
297 
298  return os;
299 }
300 
301 /** Formatted output of the RoundingPolicy type.
302  *
303  * @param[out] os Output stream.
304  * @param[in] rounding_policy Type to output.
305  *
306  * @return Modified output stream.
307  */
308 inline ::std::ostream &operator<<(::std::ostream &os, const RoundingPolicy &rounding_policy)
309 {
310  switch(rounding_policy)
311  {
313  os << "TO_ZERO";
314  break;
316  os << "TO_NEAREST_UP";
317  break;
319  os << "TO_NEAREST_EVEN";
320  break;
321  default:
322  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
323  }
324 
325  return os;
326 }
327 
328 /** Formatted output of the WeightsInfo type.
329  *
330  * @param[out] os Output stream.
331  * @param[in] weights_info Type to output.
332  *
333  * @return Modified output stream.
334  */
335 inline ::std::ostream &operator<<(::std::ostream &os, const WeightsInfo &weights_info)
336 {
337  os << weights_info.are_reshaped() << ";";
338  os << weights_info.num_kernels() << ";" << weights_info.kernel_size().first << "," << weights_info.kernel_size().second;
339 
340  return os;
341 }
342 
343 /** Formatted output of the ROIPoolingInfo type.
344  *
345  * @param[out] os Output stream.
346  * @param[in] pool_info Type to output.
347  *
348  * @return Modified output stream.
349  */
350 inline ::std::ostream &operator<<(::std::ostream &os, const ROIPoolingLayerInfo &pool_info)
351 {
352  os << pool_info.pooled_width() << "x" << pool_info.pooled_height() << "~" << pool_info.spatial_scale();
353  return os;
354 }
355 
356 /** Formatted output of the ROIPoolingInfo type.
357  *
358  * @param[in] pool_info Type to output.
359  *
360  * @return Formatted string.
361  */
362 inline std::string to_string(const ROIPoolingLayerInfo &pool_info)
363 {
364  std::stringstream str;
365  str << pool_info;
366  return str.str();
367 }
368 
369 /** Formatted output of the GEMMKernelInfo type.
370  *
371  * @param[out] os Output stream.
372  * @param[in] gemm_info Type to output.
373  *
374  * @return Modified output stream.
375  */
376 inline ::std::ostream &operator<<(::std::ostream &os, const GEMMKernelInfo &gemm_info)
377 {
378  os << "( m=" << gemm_info.m;
379  os << " n=" << gemm_info.n;
380  os << " k=" << gemm_info.k;
381  os << " depth_output_gemm3d=" << gemm_info.depth_output_gemm3d;
382  os << " reinterpret_input_as_3d=" << gemm_info.reinterpret_input_as_3d;
383  os << " broadcast_bias=" << gemm_info.broadcast_bias;
384  os << " fp_mixed_precision=" << gemm_info.fp_mixed_precision;
385  os << " mult_transpose1xW_width=" << gemm_info.mult_transpose1xW_width;
386  os << " mult_interleave4x4_height=" << gemm_info.mult_interleave4x4_height;
387  os << " a_offset=" << gemm_info.a_offset;
388  os << " b_offset=" << gemm_info.b_offset;
389  os << "post_ops=" << gemm_info.post_ops;
390  os << ")";
391  return os;
392 }
393 
394 /** Formatted output of the GEMMLHSMatrixInfo type.
395  *
396  * @param[out] os Output stream.
397  * @param[in] gemm_info Type to output.
398  *
399  * @return Modified output stream.
400  */
401 inline ::std::ostream &operator<<(::std::ostream &os, const GEMMLHSMatrixInfo &gemm_info)
402 {
403  os << "( m0=" << (unsigned int)gemm_info.m0 << " k0=" << gemm_info.k0 << " v0=" << gemm_info.v0 << " trans=" << gemm_info.transpose << " inter=" << gemm_info.interleave << "})";
404  return os;
405 }
406 
407 /** Formatted output of the GEMMRHSMatrixInfo type.
408  *
409  * @param[out] os Output stream.
410  * @param[in] gemm_info Type to output.
411  *
412  * @return Modified output stream.
413  */
414 inline ::std::ostream &operator<<(::std::ostream &os, const GEMMRHSMatrixInfo &gemm_info)
415 {
416  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=" <<
417  gemm_info.export_to_cl_image << "})";
418  return os;
419 }
420 
421 /** Formatted output of the GEMMRHSMatrixInfo type.
422  *
423  * @param[in] gemm_info GEMMRHSMatrixInfo to output.
424  *
425  * @return Formatted string.
426  */
427 inline std::string to_string(const GEMMRHSMatrixInfo &gemm_info)
428 {
429  std::stringstream str;
430  str << gemm_info;
431  return str.str();
432 }
433 
434 /** Formatted output of the GEMMLHSMatrixInfo type.
435  *
436  * @param[in] gemm_info GEMMLHSMatrixInfo to output.
437  *
438  * @return Formatted string.
439  */
440 inline std::string to_string(const GEMMLHSMatrixInfo &gemm_info)
441 {
442  std::stringstream str;
443  str << gemm_info;
444  return str.str();
445 }
446 
447 /** Formatted output of the GEMMKernelInfo type.
448  *
449  * @param[in] gemm_info GEMMKernelInfo Type to output.
450  *
451  * @return Formatted string.
452  */
453 inline std::string to_string(const GEMMKernelInfo &gemm_info)
454 {
455  std::stringstream str;
456  str << gemm_info;
457  return str.str();
458 }
459 
460 /** Formatted output of the BoundingBoxTransformInfo type.
461  *
462  * @param[out] os Output stream.
463  * @param[in] bbox_info Type to output.
464  *
465  * @return Modified output stream.
466  */
467 inline ::std::ostream &operator<<(::std::ostream &os, const BoundingBoxTransformInfo &bbox_info)
468 {
469  auto weights = bbox_info.weights();
470  os << "(" << bbox_info.img_width() << "x" << bbox_info.img_height() << ")~" << bbox_info.scale() << "(weights={" << weights[0] << ", " << weights[1] << ", " << weights[2] << ", " << weights[3] <<
471  "})";
472  return os;
473 }
474 
475 #if defined(ARM_COMPUTE_ENABLE_BF16)
476 inline ::std::ostream &operator<<(::std::ostream &os, const bfloat16 &v)
477 {
478  std::stringstream str;
479  str << v;
480  os << str.str();
481  return os;
482 }
483 #endif /* defined(ARM_COMPUTE_ENABLE_BF16) */
484 
485 /** Formatted output of the BoundingBoxTransformInfo type.
486  *
487  * @param[in] bbox_info Type to output.
488  *
489  * @return Formatted string.
490  */
491 inline std::string to_string(const BoundingBoxTransformInfo &bbox_info)
492 {
493  std::stringstream str;
494  str << bbox_info;
495  return str.str();
496 }
497 
498 /** Formatted output of the ComputeAnchorsInfo type.
499  *
500  * @param[out] os Output stream.
501  * @param[in] anchors_info Type to output.
502  *
503  * @return Modified output stream.
504  */
505 inline ::std::ostream &operator<<(::std::ostream &os, const ComputeAnchorsInfo &anchors_info)
506 {
507  os << "(" << anchors_info.feat_width() << "x" << anchors_info.feat_height() << ")~" << anchors_info.spatial_scale();
508  return os;
509 }
510 
511 /** Formatted output of the ComputeAnchorsInfo type.
512  *
513  * @param[in] anchors_info Type to output.
514  *
515  * @return Formatted string.
516  */
517 inline std::string to_string(const ComputeAnchorsInfo &anchors_info)
518 {
519  std::stringstream str;
520  str << anchors_info;
521  return str.str();
522 }
523 
524 /** Formatted output of the GenerateProposalsInfo type.
525  *
526  * @param[out] os Output stream.
527  * @param[in] proposals_info Type to output.
528  *
529  * @return Modified output stream.
530  */
531 inline ::std::ostream &operator<<(::std::ostream &os, const GenerateProposalsInfo &proposals_info)
532 {
533  os << "(" << proposals_info.im_width() << "x" << proposals_info.im_height() << ")~" << proposals_info.im_scale();
534  return os;
535 }
536 
537 /** Formatted output of the GenerateProposalsInfo type.
538  *
539  * @param[in] proposals_info Type to output.
540  *
541  * @return Formatted string.
542  */
543 inline std::string to_string(const GenerateProposalsInfo &proposals_info)
544 {
545  std::stringstream str;
546  str << proposals_info;
547  return str.str();
548 }
549 
550 /** Formatted output of the QuantizationInfo type.
551  *
552  * @param[out] os Output stream.
553  * @param[in] qinfo Type to output.
554  *
555  * @return Modified output stream.
556  */
557 inline ::std::ostream &operator<<(::std::ostream &os, const QuantizationInfo &qinfo)
558 {
559  const UniformQuantizationInfo uqinfo = qinfo.uniform();
560  os << "Scale:" << uqinfo.scale << "~";
561  os << "Offset:" << uqinfo.offset;
562  return os;
563 }
564 
565 /** Formatted output of the QuantizationInfo type.
566  *
567  * @param[in] quantization_info Type to output.
568  *
569  * @return Formatted string.
570  */
571 inline std::string to_string(const QuantizationInfo &quantization_info)
572 {
573  std::stringstream str;
574  str << quantization_info;
575  return str.str();
576 }
577 
578 /** Formatted output of the activation function type.
579  *
580  * @param[out] os Output stream.
581  * @param[in] act_function Type to output.
582  *
583  * @return Modified output stream.
584  */
585 inline ::std::ostream &operator<<(::std::ostream &os, const ActivationLayerInfo::ActivationFunction &act_function)
586 {
587  switch(act_function)
588  {
590  os << "ABS";
591  break;
593  os << "LINEAR";
594  break;
596  os << "LOGISTIC";
597  break;
599  os << "RELU";
600  break;
602  os << "BOUNDED_RELU";
603  break;
605  os << "LEAKY_RELU";
606  break;
608  os << "SOFT_RELU";
609  break;
611  os << "SQRT";
612  break;
614  os << "LU_BOUNDED_RELU";
615  break;
617  os << "ELU";
618  break;
620  os << "SQUARE";
621  break;
623  os << "TANH";
624  break;
626  os << "IDENTITY";
627  break;
629  os << "HARD_SWISH";
630  break;
631 
632  default:
633  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
634  }
635 
636  return os;
637 }
638 
639 /** Formatted output of the activation function info type.
640  *
641  * @param[in] info ActivationLayerInfo to output.
642  *
643  * @return Formatted string.
644  */
646 {
647  std::stringstream str;
648  if(info.enabled())
649  {
650  str << info.activation();
651  }
652  return str.str();
653 }
654 
655 /** Formatted output of the activation function info.
656  *
657  * @param[out] os Output stream.
658  * @param[in] info ActivationLayerInfo to output.
659  *
660  * @return Formatted string.
661  */
662 inline ::std::ostream &operator<<(::std::ostream &os, const ActivationLayerInfo *info)
663 {
664  if(info != nullptr)
665  {
666  if(info->enabled())
667  {
668  os << info->activation();
669  os << "(";
670  os << "VAL_A=" << info->a() << ",";
671  os << "VAL_B=" << info->b();
672  os << ")";
673  }
674  else
675  {
676  os << "disabled";
677  }
678  }
679  else
680  {
681  os << "nullptr";
682  }
683  return os;
684 }
685 
686 /** Formatted output of the activation function type.
687  *
688  * @param[in] function Type to output.
689  *
690  * @return Formatted string.
691  */
693 {
694  std::stringstream str;
695  str << function;
696  return str.str();
697 }
698 
699 /** Formatted output of the NormType type.
700  *
701  * @param[out] os Output stream.
702  * @param[in] norm_type Type to output.
703  *
704  * @return Modified output stream.
705  */
706 inline ::std::ostream &operator<<(::std::ostream &os, const NormType &norm_type)
707 {
708  switch(norm_type)
709  {
710  case NormType::CROSS_MAP:
711  os << "CROSS_MAP";
712  break;
713  case NormType::IN_MAP_1D:
714  os << "IN_MAP_1D";
715  break;
716  case NormType::IN_MAP_2D:
717  os << "IN_MAP_2D";
718  break;
719  default:
720  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
721  }
722 
723  return os;
724 }
725 
726 /** Formatted output of @ref NormalizationLayerInfo.
727  *
728  * @param[in] info Type to output.
729  *
730  * @return Formatted string.
731  */
733 {
734  std::stringstream str;
735  str << info.type() << ":NormSize=" << info.norm_size();
736  return str.str();
737 }
738 
739 /** Formatted output of @ref NormalizationLayerInfo.
740  *
741  * @param[out] os Output stream.
742  * @param[in] info Type to output.
743  *
744  * @return Modified output stream.
745  */
746 inline ::std::ostream &operator<<(::std::ostream &os, const NormalizationLayerInfo &info)
747 {
748  os << info.type() << ":NormSize=" << info.norm_size();
749  return os;
750 }
751 
752 /** Formatted output of the PoolingType type.
753  *
754  * @param[out] os Output stream.
755  * @param[in] pool_type Type to output.
756  *
757  * @return Modified output stream.
758  */
759 inline ::std::ostream &operator<<(::std::ostream &os, const PoolingType &pool_type)
760 {
761  switch(pool_type)
762  {
763  case PoolingType::AVG:
764  os << "AVG";
765  break;
766  case PoolingType::MAX:
767  os << "MAX";
768  break;
769  case PoolingType::L2:
770  os << "L2";
771  break;
772  default:
773  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
774  }
775 
776  return os;
777 }
778 
779 /** Formatted output of @ref PoolingLayerInfo.
780  *
781  * @param[out] os Output stream.
782  * @param[in] info Type to output.
783  *
784  * @return Modified output stream.
785  */
786 inline ::std::ostream &operator<<(::std::ostream &os, const PoolingLayerInfo &info)
787 {
788  os << info.pool_type;
789 
790  return os;
791 }
792 
793 /** Formatted output of @ref RoundingPolicy.
794  *
795  * @param[in] rounding_policy Type to output.
796  *
797  * @return Formatted string.
798  */
799 inline std::string to_string(const RoundingPolicy &rounding_policy)
800 {
801  std::stringstream str;
802  str << rounding_policy;
803  return str.str();
804 }
805 
806 /** [Print DataLayout type] **/
807 /** Formatted output of the DataLayout type.
808  *
809  * @param[out] os Output stream.
810  * @param[in] data_layout Type to output.
811  *
812  * @return Modified output stream.
813  */
814 inline ::std::ostream &operator<<(::std::ostream &os, const DataLayout &data_layout)
815 {
816  switch(data_layout)
817  {
818  case DataLayout::UNKNOWN:
819  os << "UNKNOWN";
820  break;
821  case DataLayout::NHWC:
822  os << "NHWC";
823  break;
824  case DataLayout::NCHW:
825  os << "NCHW";
826  break;
827  case DataLayout::NDHWC:
828  os << "NDHWC";
829  break;
830  case DataLayout::NCDHW:
831  os << "NCDHW";
832  break;
833  default:
834  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
835  }
836 
837  return os;
838 }
839 
840 /** Formatted output of the DataLayout type.
841  *
842  * @param[in] data_layout Type to output.
843  *
844  * @return Formatted string.
845  */
847 {
848  std::stringstream str;
849  str << data_layout;
850  return str.str();
851 }
852 /** [Print DataLayout type] **/
853 
854 /** Formatted output of the DataLayoutDimension type.
855  *
856  * @param[out] os Output stream.
857  * @param[in] data_layout_dim Data layout dimension to print.
858  *
859  * @return Modified output stream.
860  */
861 inline ::std::ostream &operator<<(::std::ostream &os, const DataLayoutDimension &data_layout_dim)
862 {
863  switch(data_layout_dim)
864  {
866  os << "WIDTH";
867  break;
869  os << "HEIGHT";
870  break;
872  os << "CHANNEL";
873  break;
875  os << "DEPTH";
876  break;
878  os << "BATCHES";
879  break;
880  default:
881  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
882  }
883  return os;
884 }
885 
886 /** Formatted output of the DataType type.
887  *
888  * @param[out] os Output stream.
889  * @param[in] data_type Type to output.
890  *
891  * @return Modified output stream.
892  */
893 inline ::std::ostream &operator<<(::std::ostream &os, const DataType &data_type)
894 {
895  switch(data_type)
896  {
897  case DataType::UNKNOWN:
898  os << "UNKNOWN";
899  break;
900  case DataType::U8:
901  os << "U8";
902  break;
903  case DataType::QSYMM8:
904  os << "QSYMM8";
905  break;
906  case DataType::QASYMM8:
907  os << "QASYMM8";
908  break;
910  os << "QASYMM8_SIGNED";
911  break;
913  os << "QSYMM8_PER_CHANNEL";
914  break;
915  case DataType::S8:
916  os << "S8";
917  break;
918  case DataType::U16:
919  os << "U16";
920  break;
921  case DataType::S16:
922  os << "S16";
923  break;
924  case DataType::QSYMM16:
925  os << "QSYMM16";
926  break;
927  case DataType::QASYMM16:
928  os << "QASYMM16";
929  break;
930  case DataType::U32:
931  os << "U32";
932  break;
933  case DataType::S32:
934  os << "S32";
935  break;
936  case DataType::U64:
937  os << "U64";
938  break;
939  case DataType::S64:
940  os << "S64";
941  break;
942  case DataType::BFLOAT16:
943  os << "BFLOAT16";
944  break;
945  case DataType::F16:
946  os << "F16";
947  break;
948  case DataType::F32:
949  os << "F32";
950  break;
951  case DataType::F64:
952  os << "F64";
953  break;
954  case DataType::SIZET:
955  os << "SIZET";
956  break;
957  default:
958  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
959  }
960 
961  return os;
962 }
963 
964 /** Formatted output of the DataType type.
965  *
966  * @param[in] data_type Type to output.
967  *
968  * @return Formatted string.
969  */
970 inline std::string to_string(const arm_compute::DataType &data_type)
971 {
972  std::stringstream str;
973  str << data_type;
974  return str.str();
975 }
976 
977 /** Formatted output of the Format type.
978  *
979  * @param[out] os Output stream.
980  * @param[in] format Type to output.
981  *
982  * @return Modified output stream.
983  */
984 inline ::std::ostream &operator<<(::std::ostream &os, const Format &format)
985 {
986  switch(format)
987  {
988  case Format::UNKNOWN:
989  os << "UNKNOWN";
990  break;
991  case Format::U8:
992  os << "U8";
993  break;
994  case Format::S16:
995  os << "S16";
996  break;
997  case Format::U16:
998  os << "U16";
999  break;
1000  case Format::S32:
1001  os << "S32";
1002  break;
1003  case Format::U32:
1004  os << "U32";
1005  break;
1006  case Format::F16:
1007  os << "F16";
1008  break;
1009  case Format::F32:
1010  os << "F32";
1011  break;
1012  case Format::UV88:
1013  os << "UV88";
1014  break;
1015  case Format::RGB888:
1016  os << "RGB888";
1017  break;
1018  case Format::RGBA8888:
1019  os << "RGBA8888";
1020  break;
1021  case Format::YUV444:
1022  os << "YUV444";
1023  break;
1024  case Format::YUYV422:
1025  os << "YUYV422";
1026  break;
1027  case Format::NV12:
1028  os << "NV12";
1029  break;
1030  case Format::NV21:
1031  os << "NV21";
1032  break;
1033  case Format::IYUV:
1034  os << "IYUV";
1035  break;
1036  case Format::UYVY422:
1037  os << "UYVY422";
1038  break;
1039  default:
1040  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1041  }
1042 
1043  return os;
1044 }
1045 
1046 /** Formatted output of the Format type.
1047  *
1048  * @param[in] format Type to output.
1049  *
1050  * @return Formatted string.
1051  */
1052 inline std::string to_string(const Format &format)
1053 {
1054  std::stringstream str;
1055  str << format;
1056  return str.str();
1057 }
1058 
1059 /** Formatted output of the Channel type.
1060  *
1061  * @param[out] os Output stream.
1062  * @param[in] channel Type to output.
1063  *
1064  * @return Modified output stream.
1065  */
1066 inline ::std::ostream &operator<<(::std::ostream &os, const Channel &channel)
1067 {
1068  switch(channel)
1069  {
1070  case Channel::UNKNOWN:
1071  os << "UNKNOWN";
1072  break;
1073  case Channel::C0:
1074  os << "C0";
1075  break;
1076  case Channel::C1:
1077  os << "C1";
1078  break;
1079  case Channel::C2:
1080  os << "C2";
1081  break;
1082  case Channel::C3:
1083  os << "C3";
1084  break;
1085  case Channel::R:
1086  os << "R";
1087  break;
1088  case Channel::G:
1089  os << "G";
1090  break;
1091  case Channel::B:
1092  os << "B";
1093  break;
1094  case Channel::A:
1095  os << "A";
1096  break;
1097  case Channel::Y:
1098  os << "Y";
1099  break;
1100  case Channel::U:
1101  os << "U";
1102  break;
1103  case Channel::V:
1104  os << "V";
1105  break;
1106  default:
1107  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1108  }
1109 
1110  return os;
1111 }
1112 
1113 /** Formatted output of the Channel type.
1114  *
1115  * @param[in] channel Type to output.
1116  *
1117  * @return Formatted string.
1118  */
1119 inline std::string to_string(const Channel &channel)
1120 {
1121  std::stringstream str;
1122  str << channel;
1123  return str.str();
1124 }
1125 
1126 /** Formatted output of the BorderMode type.
1127  *
1128  * @param[out] os Output stream.
1129  * @param[in] mode Type to output.
1130  *
1131  * @return Modified output stream.
1132  */
1133 inline ::std::ostream &operator<<(::std::ostream &os, const BorderMode &mode)
1134 {
1135  switch(mode)
1136  {
1137  case BorderMode::UNDEFINED:
1138  os << "UNDEFINED";
1139  break;
1140  case BorderMode::CONSTANT:
1141  os << "CONSTANT";
1142  break;
1143  case BorderMode::REPLICATE:
1144  os << "REPLICATE";
1145  break;
1146  default:
1147  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1148  }
1149 
1150  return os;
1151 }
1152 
1153 /** Formatted output of the BorderSize type.
1154  *
1155  * @param[out] os Output stream.
1156  * @param[in] border Type to output.
1157  *
1158  * @return Modified output stream.
1159  */
1160 inline ::std::ostream &operator<<(::std::ostream &os, const BorderSize &border)
1161 {
1162  os << border.top << ","
1163  << border.right << ","
1164  << border.bottom << ","
1165  << border.left;
1166 
1167  return os;
1168 }
1169 
1170 /** Formatted output of the PaddingList type.
1171  *
1172  * @param[out] os Output stream.
1173  * @param[in] padding Type to output.
1174  *
1175  * @return Modified output stream.
1176  */
1177 inline ::std::ostream &operator<<(::std::ostream &os, const PaddingList &padding)
1178 {
1179  os << "{";
1180  for(auto const &p : padding)
1181  {
1182  os << "{" << p.first << "," << p.second << "}";
1183  }
1184  os << "}";
1185  return os;
1186 }
1187 
1188 /** Formatted output of the Multiples type.
1189  *
1190  * @param[out] os Output stream.
1191  * @param[in] multiples Type to output.
1192  *
1193  * @return Modified output stream.
1194  */
1195 inline ::std::ostream &operator<<(::std::ostream &os, const Multiples &multiples)
1196 {
1197  os << "(";
1198  for(size_t i = 0; i < multiples.size() - 1; i++)
1199  {
1200  os << multiples[i] << ", ";
1201  }
1202  os << multiples.back() << ")";
1203  return os;
1204 }
1205 
1206 /** Formatted output of the InterpolationPolicy type.
1207  *
1208  * @param[out] os Output stream.
1209  * @param[in] policy Type to output.
1210  *
1211  * @return Modified output stream.
1212  */
1213 inline ::std::ostream &operator<<(::std::ostream &os, const InterpolationPolicy &policy)
1214 {
1215  switch(policy)
1216  {
1218  os << "NEAREST_NEIGHBOR";
1219  break;
1221  os << "BILINEAR";
1222  break;
1224  os << "AREA";
1225  break;
1226  default:
1227  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1228  }
1229 
1230  return os;
1231 }
1232 
1233 /** Formatted output of the SamplingPolicy type.
1234  *
1235  * @param[out] os Output stream.
1236  * @param[in] policy Type to output.
1237  *
1238  * @return Modified output stream.
1239  */
1240 inline ::std::ostream &operator<<(::std::ostream &os, const SamplingPolicy &policy)
1241 {
1242  switch(policy)
1243  {
1245  os << "CENTER";
1246  break;
1248  os << "TOP_LEFT";
1249  break;
1250  default:
1251  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1252  }
1253 
1254  return os;
1255 }
1256 
1257 /** Formatted output of the ITensorInfo type.
1258  *
1259  * @param[out] os Output stream.
1260  * @param[in] info Tensor information.
1261  *
1262  * @return Modified output stream.
1263  */
1264 inline ::std::ostream &operator<<(std::ostream &os, const ITensorInfo *info)
1265 {
1266  const DataType data_type = info->data_type();
1267  const DataLayout data_layout = info->data_layout();
1268 
1269  os << "Shape=" << info->tensor_shape() << ","
1270  << "DataLayout=" << string_from_data_layout(data_layout) << ","
1271  << "DataType=" << string_from_data_type(data_type);
1272 
1273  if(is_data_type_quantized(data_type))
1274  {
1275  const QuantizationInfo qinfo = info->quantization_info();
1276  const auto scales = qinfo.scale();
1277  const auto offsets = qinfo.offset();
1278 
1279  os << ", QuantizationInfo={"
1280  << "scales.size=" << scales.size()
1281  << ", scale(s)=" << scales << ", ";
1282 
1283  os << "offsets.size=" << offsets.size()
1284  << ", offset(s)=" << offsets << "}";
1285  }
1286  return os;
1287 }
1288 
1289 /** Formatted output of the const TensorInfo& type.
1290  *
1291  * @param[out] os Output stream.
1292  * @param[in] info Type to output.
1293  *
1294  * @return Modified output stream.
1295  */
1296 inline ::std::ostream &operator<<(::std::ostream &os, const TensorInfo &info)
1297 {
1298  os << &info;
1299  return os;
1300 }
1301 
1302 /** Formatted output of the const TensorInfo& type.
1303  *
1304  * @param[in] info Type to output.
1305  *
1306  * @return Formatted string.
1307  */
1308 inline std::string to_string(const TensorInfo &info)
1309 {
1310  std::stringstream str;
1311  str << &info;
1312  return str.str();
1313 }
1314 
1315 /** Formatted output of the const ITensorInfo& type.
1316  *
1317  * @param[in] info Type to output.
1318  *
1319  * @return Formatted string.
1320  */
1321 inline std::string to_string(const ITensorInfo &info)
1322 {
1323  std::stringstream str;
1324  str << &info;
1325  return str.str();
1326 }
1327 
1328 /** Formatted output of the const ITensorInfo* type.
1329  *
1330  * @param[in] info Type to output.
1331  *
1332  * @return Formatted string.
1333  */
1334 inline std::string to_string(const ITensorInfo *info)
1335 {
1336  std::string ret_str = "nullptr";
1337  if(info != nullptr)
1338  {
1339  std::stringstream str;
1340  str << info;
1341  ret_str = str.str();
1342  }
1343  return ret_str;
1344 }
1345 
1346 /** Formatted output of the ITensorInfo* type.
1347  *
1348  * @param[in] info Type to output.
1349  *
1350  * @return Formatted string.
1351  */
1352 inline std::string to_string(ITensorInfo *info)
1353 {
1354  return to_string(static_cast<const ITensorInfo *>(info));
1355 }
1356 
1357 /** Formatted output of the ITensorInfo type obtained from const ITensor* type.
1358  *
1359  * @param[in] tensor Type to output.
1360  *
1361  * @return Formatted string.
1362  */
1363 inline std::string to_string(const ITensor *tensor)
1364 {
1365  std::string ret_str = "nullptr";
1366  if(tensor != nullptr)
1367  {
1368  std::stringstream str;
1369  str << "ITensor->info(): " << tensor->info();
1370  ret_str = str.str();
1371  }
1372  return ret_str;
1373 }
1374 
1375 /** Formatted output of the ITensorInfo type obtained from the ITensor* type.
1376  *
1377  * @param[in] tensor Type to output.
1378  *
1379  * @return Formatted string.
1380  */
1381 inline std::string to_string(ITensor *tensor)
1382 {
1383  return to_string(static_cast<const ITensor *>(tensor));
1384 }
1385 
1386 /** Formatted output of the ITensorInfo type obtained from the ITensor& type.
1387  *
1388  * @param[in] tensor Type to output.
1389  *
1390  * @return Formatted string.
1391  */
1392 inline std::string to_string(ITensor &tensor)
1393 {
1394  std::stringstream str;
1395  str << "ITensor.info(): " << tensor.info();
1396  return str.str();
1397 }
1398 
1399 #ifdef ARM_COMPUTE_OPENCL_ENABLED
1400 /** Formatted output of the ITensorInfo type obtained from the const ICLTensor& type.
1401  *
1402  * @param[in] cl_tensor Type to output.
1403  *
1404  * @return Formatted string.
1405  */
1406 inline std::string to_string(const ICLTensor *cl_tensor)
1407 {
1408  std::string ret_str = "nullptr";
1409  if(cl_tensor != nullptr)
1410  {
1411  std::stringstream str;
1412  str << "ICLTensor->info(): " << cl_tensor->info();
1413  ret_str = str.str();
1414  }
1415  return ret_str;
1416 }
1417 
1418 /** Formatted output of the ITensorInfo type obtained from the ICLTensor& type.
1419  *
1420  * @param[in] cl_tensor Type to output.
1421  *
1422  * @return Formatted string.
1423  */
1424 inline std::string to_string(ICLTensor *cl_tensor)
1425 {
1426  return to_string(static_cast<const ICLTensor *>(cl_tensor));
1427 }
1428 #endif /* ARM_COMPUTE_OPENCL_ENABLED */
1429 
1430 /** Formatted output of the Dimensions type.
1431  *
1432  * @param[in] dimensions Type to output.
1433  *
1434  * @return Formatted string.
1435  */
1436 template <typename T>
1437 inline std::string to_string(const Dimensions<T> &dimensions)
1438 {
1439  std::stringstream str;
1440  str << dimensions;
1441  return str.str();
1442 }
1443 
1444 /** Formatted output of the Strides type.
1445  *
1446  * @param[in] stride Type to output.
1447  *
1448  * @return Formatted string.
1449  */
1450 inline std::string to_string(const Strides &stride)
1451 {
1452  std::stringstream str;
1453  str << stride;
1454  return str.str();
1455 }
1456 
1457 /** Formatted output of the TensorShape type.
1458  *
1459  * @param[in] shape Type to output.
1460  *
1461  * @return Formatted string.
1462  */
1463 inline std::string to_string(const TensorShape &shape)
1464 {
1465  std::stringstream str;
1466  str << shape;
1467  return str.str();
1468 }
1469 
1470 /** Formatted output of the Coordinates type.
1471  *
1472  * @param[in] coord Type to output.
1473  *
1474  * @return Formatted string.
1475  */
1476 inline std::string to_string(const Coordinates &coord)
1477 {
1478  std::stringstream str;
1479  str << coord;
1480  return str.str();
1481 }
1482 
1483 /** Formatted output of the GEMMReshapeInfo type.
1484  *
1485  * @param[out] os Output stream.
1486  * @param[in] info Type to output.
1487  *
1488  * @return Modified output stream.
1489  */
1490 inline ::std::ostream &operator<<(::std::ostream &os, const GEMMReshapeInfo &info)
1491 {
1492  os << "{m=" << info.m() << ",";
1493  os << "n=" << info.n() << ",";
1494  os << "k=" << info.k() << ",";
1495  os << "mult_transpose1xW_width=" << info.mult_transpose1xW_width() << ",";
1496  os << "mult_interleave4x4_height=" << info.mult_interleave4x4_height();
1497  os << "}";
1498 
1499  return os;
1500 }
1501 
1502 /** Formatted output of the GEMMInfo type.
1503  *
1504  * @param[out] os Output stream.
1505  * @param[in] info Type to output.
1506  *
1507  * @return Modified output stream.
1508  */
1509 inline ::std::ostream &operator<<(::std::ostream &os, const GEMMInfo &info)
1510 {
1511  os << "{is_a_reshaped=" << info.is_a_reshaped() << ",";
1512  os << "is_b_reshaped=" << info.is_b_reshaped() << ",";
1513  os << "reshape_b_only_on_first_run=" << info.reshape_b_only_on_first_run() << ",";
1514  os << "depth_output_gemm3d=" << info.depth_output_gemm3d() << ",";
1515  os << "reinterpret_input_as_3d=" << info.reinterpret_input_as_3d() << ",";
1516  os << "retain_internal_weights=" << info.retain_internal_weights() << ",";
1517  os << "fp_mixed_precision=" << info.fp_mixed_precision() << ",";
1518  os << "broadcast_bias=" << info.broadcast_bias() << ",";
1519  os << "pretranspose_B=" << info.pretranspose_B() << ",";
1520  os << "post_ops=" << info.post_ops() << "}";
1521 
1522  return os;
1523 }
1524 
1525 /** Formatted output of the Window::Dimension type.
1526  *
1527  * @param[out] os Output stream.
1528  * @param[in] dim Type to output.
1529  *
1530  * @return Modified output stream.
1531  */
1532 inline ::std::ostream &operator<<(::std::ostream &os, const Window::Dimension &dim)
1533 {
1534  os << "{start=" << dim.start() << ", end=" << dim.end() << ", step=" << dim.step() << "}";
1535 
1536  return os;
1537 }
1538 /** Formatted output of the Window type.
1539  *
1540  * @param[out] os Output stream.
1541  * @param[in] win Type to output.
1542  *
1543  * @return Modified output stream.
1544  */
1545 inline ::std::ostream &operator<<(::std::ostream &os, const Window &win)
1546 {
1547  os << "{";
1548  for(unsigned int i = 0; i < Coordinates::num_max_dimensions; i++)
1549  {
1550  if(i > 0)
1551  {
1552  os << ", ";
1553  }
1554  os << win[i];
1555  }
1556  os << "}";
1557 
1558  return os;
1559 }
1560 
1561 /** Formatted output of the WeightsInfo type.
1562  *
1563  * @param[in] info Type to output.
1564  *
1565  * @return Formatted string.
1566  */
1567 inline std::string to_string(const WeightsInfo &info)
1568 {
1569  std::stringstream str;
1570  str << info;
1571  return str.str();
1572 }
1573 
1574 /** Formatted output of the GEMMReshapeInfo type.
1575  *
1576  * @param[in] info Type to output.
1577  *
1578  * @return Formatted string.
1579  */
1580 inline std::string to_string(const GEMMReshapeInfo &info)
1581 {
1582  std::stringstream str;
1583  str << info;
1584  return str.str();
1585 }
1586 
1587 /** Formatted output of the GEMMInfo type.
1588  *
1589  * @param[in] info Type to output.
1590  *
1591  * @return Formatted string.
1592  */
1593 inline std::string to_string(const GEMMInfo &info)
1594 {
1595  std::stringstream str;
1596  str << info;
1597  return str.str();
1598 }
1599 
1600 /** Formatted output of the Window::Dimension type.
1601  *
1602  * @param[in] dim Type to output.
1603  *
1604  * @return Formatted string.
1605  */
1606 inline std::string to_string(const Window::Dimension &dim)
1607 {
1608  std::stringstream str;
1609  str << dim;
1610  return str.str();
1611 }
1612 /** Formatted output of the Window& type.
1613  *
1614  * @param[in] win Type to output.
1615  *
1616  * @return Formatted string.
1617  */
1618 inline std::string to_string(const Window &win)
1619 {
1620  std::stringstream str;
1621  str << win;
1622  return str.str();
1623 }
1624 
1625 /** Formatted output of the Window* type.
1626  *
1627  * @param[in] win Type to output.
1628  *
1629  * @return Formatted string.
1630  */
1631 inline std::string to_string(Window *win)
1632 {
1633  std::string ret_str = "nullptr";
1634  if(win != nullptr)
1635  {
1636  std::stringstream str;
1637  str << *win;
1638  ret_str = str.str();
1639  }
1640  return ret_str;
1641 }
1642 
1643 /** Formatted output of the Rectangle type.
1644  *
1645  * @param[out] os Output stream.
1646  * @param[in] rect Type to output.
1647  *
1648  * @return Modified output stream.
1649  */
1650 inline ::std::ostream &operator<<(::std::ostream &os, const Rectangle &rect)
1651 {
1652  os << rect.width << "x" << rect.height;
1653  os << "+" << rect.x << "+" << rect.y;
1654 
1655  return os;
1656 }
1657 
1658 /** Formatted output of the PaddingMode type.
1659  *
1660  * @param[out] os Output stream.
1661  * @param[in] mode Type to output.
1662  *
1663  * @return Modified output stream.
1664  */
1665 inline ::std::ostream &operator<<(::std::ostream &os, const PaddingMode &mode)
1666 {
1667  switch(mode)
1668  {
1669  case PaddingMode::CONSTANT:
1670  os << "CONSTANT";
1671  break;
1672  case PaddingMode::REFLECT:
1673  os << "REFLECT";
1674  break;
1676  os << "SYMMETRIC";
1677  break;
1678  default:
1679  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1680  }
1681 
1682  return os;
1683 }
1684 
1685 /** Formatted output of the PaddingMode type.
1686  *
1687  * @param[in] mode Type to output.
1688  *
1689  * @return Formatted string.
1690  */
1691 inline std::string to_string(const PaddingMode &mode)
1692 {
1693  std::stringstream str;
1694  str << mode;
1695  return str.str();
1696 }
1697 
1698 /** Formatted output of the PadStrideInfo type.
1699  *
1700  * @param[out] os Output stream.
1701  * @param[in] pad_stride_info Type to output.
1702  *
1703  * @return Modified output stream.
1704  */
1705 inline ::std::ostream &operator<<(::std::ostream &os, const PadStrideInfo &pad_stride_info)
1706 {
1707  os << pad_stride_info.stride().first << "," << pad_stride_info.stride().second;
1708  os << ";";
1709  os << pad_stride_info.pad_left() << "," << pad_stride_info.pad_right() << ","
1710  << pad_stride_info.pad_top() << "," << pad_stride_info.pad_bottom();
1711 
1712  return os;
1713 }
1714 
1715 /** Formatted output of the PadStrideInfo type.
1716  *
1717  * @param[in] pad_stride_info Type to output.
1718  *
1719  * @return Formatted string.
1720  */
1721 inline std::string to_string(const PadStrideInfo &pad_stride_info)
1722 {
1723  std::stringstream str;
1724  str << pad_stride_info;
1725  return str.str();
1726 }
1727 
1728 /** Formatted output of the BorderMode type.
1729  *
1730  * @param[in] mode Type to output.
1731  *
1732  * @return Formatted string.
1733  */
1734 inline std::string to_string(const BorderMode &mode)
1735 {
1736  std::stringstream str;
1737  str << mode;
1738  return str.str();
1739 }
1740 
1741 /** Formatted output of the BorderSize type.
1742  *
1743  * @param[in] border Type to output.
1744  *
1745  * @return Formatted string.
1746  */
1747 inline std::string to_string(const BorderSize &border)
1748 {
1749  std::stringstream str;
1750  str << border;
1751  return str.str();
1752 }
1753 
1754 /** Formatted output of the PaddingList type.
1755  *
1756  * @param[in] padding Type to output.
1757  *
1758  * @return Formatted string.
1759  */
1760 inline std::string to_string(const PaddingList &padding)
1761 {
1762  std::stringstream str;
1763  str << padding;
1764  return str.str();
1765 }
1766 
1767 /** Formatted output of the Multiples type.
1768  *
1769  * @param[in] multiples Type to output.
1770  *
1771  * @return Formatted string.
1772  */
1773 inline std::string to_string(const Multiples &multiples)
1774 {
1775  std::stringstream str;
1776  str << multiples;
1777  return str.str();
1778 }
1779 
1780 /** Formatted output of the InterpolationPolicy type.
1781  *
1782  * @param[in] policy Type to output.
1783  *
1784  * @return Formatted string.
1785  */
1786 inline std::string to_string(const InterpolationPolicy &policy)
1787 {
1788  std::stringstream str;
1789  str << policy;
1790  return str.str();
1791 }
1792 
1793 /** Formatted output of the SamplingPolicy type.
1794  *
1795  * @param[in] policy Type to output.
1796  *
1797  * @return Formatted string.
1798  */
1799 inline std::string to_string(const SamplingPolicy &policy)
1800 {
1801  std::stringstream str;
1802  str << policy;
1803  return str.str();
1804 }
1805 
1806 /** Formatted output of the ConvertPolicy type.
1807  *
1808  * @param[out] os Output stream.
1809  * @param[in] policy Type to output.
1810  *
1811  * @return Modified output stream.
1812  */
1813 inline ::std::ostream &operator<<(::std::ostream &os, const ConvertPolicy &policy)
1814 {
1815  switch(policy)
1816  {
1817  case ConvertPolicy::WRAP:
1818  os << "WRAP";
1819  break;
1821  os << "SATURATE";
1822  break;
1823  default:
1824  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1825  }
1826 
1827  return os;
1828 }
1829 
1830 inline std::string to_string(const ConvertPolicy &policy)
1831 {
1832  std::stringstream str;
1833  str << policy;
1834  return str.str();
1835 }
1836 
1837 /** Formatted output of the ArithmeticOperation type.
1838  *
1839  * @param[out] os Output stream.
1840  * @param[in] op Operation to output.
1841  *
1842  * @return Modified output stream.
1843  */
1844 inline ::std::ostream &operator<<(::std::ostream &os, const ArithmeticOperation &op)
1845 {
1846  switch(op)
1847  {
1849  os << "ADD";
1850  break;
1852  os << "SUB";
1853  break;
1855  os << "DIV";
1856  break;
1858  os << "MAX";
1859  break;
1861  os << "MIN";
1862  break;
1864  os << "SQUARED_DIFF";
1865  break;
1867  os << "POWER";
1868  break;
1869  default:
1870  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1871  }
1872 
1873  return os;
1874 }
1875 
1876 /** Formatted output of the Arithmetic Operation
1877  *
1878  * @param[in] op Type to output.
1879  *
1880  * @return Formatted string.
1881  */
1882 inline std::string to_string(const ArithmeticOperation &op)
1883 {
1884  std::stringstream str;
1885  str << op;
1886  return str.str();
1887 }
1888 
1889 /** Formatted output of the Reduction Operations.
1890  *
1891  * @param[out] os Output stream.
1892  * @param[in] op Type to output.
1893  *
1894  * @return Modified output stream.
1895  */
1896 inline ::std::ostream &operator<<(::std::ostream &os, const ReductionOperation &op)
1897 {
1898  switch(op)
1899  {
1901  os << "SUM";
1902  break;
1904  os << "SUM_SQUARE";
1905  break;
1907  os << "MEAN_SUM";
1908  break;
1910  os << "ARG_IDX_MAX";
1911  break;
1913  os << "ARG_IDX_MIN";
1914  break;
1916  os << "PROD";
1917  break;
1919  os << "MIN";
1920  break;
1922  os << "MAX";
1923  break;
1924  default:
1925  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1926  }
1927 
1928  return os;
1929 }
1930 
1931 /** Formatted output of the Reduction Operations.
1932  *
1933  * @param[in] op Type to output.
1934  *
1935  * @return Formatted string.
1936  */
1937 inline std::string to_string(const ReductionOperation &op)
1938 {
1939  std::stringstream str;
1940  str << op;
1941  return str.str();
1942 }
1943 
1944 /** Formatted output of the Comparison Operations.
1945  *
1946  * @param[out] os Output stream.
1947  * @param[in] op Type to output.
1948  *
1949  * @return Modified output stream.
1950  */
1951 inline ::std::ostream &operator<<(::std::ostream &os, const ComparisonOperation &op)
1952 {
1953  switch(op)
1954  {
1956  os << "Equal";
1957  break;
1959  os << "NotEqual";
1960  break;
1962  os << "Greater";
1963  break;
1965  os << "GreaterEqual";
1966  break;
1968  os << "Less";
1969  break;
1971  os << "LessEqual";
1972  break;
1973  default:
1974  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1975  }
1976 
1977  return os;
1978 }
1979 
1980 /** Formatted output of the Elementwise unary Operations.
1981  *
1982  * @param[out] os Output stream.
1983  * @param[in] op Type to output.
1984  *
1985  * @return Modified output stream.
1986  */
1987 inline ::std::ostream &operator<<(::std::ostream &os, const ElementWiseUnary &op)
1988 {
1989  switch(op)
1990  {
1992  os << "RSQRT";
1993  break;
1994  case ElementWiseUnary::EXP:
1995  os << "EXP";
1996  break;
1997  case ElementWiseUnary::NEG:
1998  os << "NEG";
1999  break;
2000  case ElementWiseUnary::LOG:
2001  os << "LOG";
2002  break;
2003  case ElementWiseUnary::SIN:
2004  os << "SIN";
2005  break;
2006  case ElementWiseUnary::ABS:
2007  os << "ABS";
2008  break;
2010  os << "ROUND";
2011  break;
2013  os << "LOGICAL_NOT";
2014  break;
2015  default:
2016  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2017  }
2018 
2019  return os;
2020 }
2021 
2022 /** Formatted output of the Comparison Operations.
2023  *
2024  * @param[in] op Type to output.
2025  *
2026  * @return Formatted string.
2027  */
2028 inline std::string to_string(const ComparisonOperation &op)
2029 {
2030  std::stringstream str;
2031  str << op;
2032  return str.str();
2033 }
2034 
2035 /** Formatted output of the Elementwise unary Operations.
2036  *
2037  * @param[in] op Type to output.
2038  *
2039  * @return Formatted string.
2040  */
2041 inline std::string to_string(const ElementWiseUnary &op)
2042 {
2043  std::stringstream str;
2044  str << op;
2045  return str.str();
2046 }
2047 
2048 /** Formatted output of the Norm Type.
2049  *
2050  * @param[in] type Type to output.
2051  *
2052  * @return Formatted string.
2053  */
2054 inline std::string to_string(const NormType &type)
2055 {
2056  std::stringstream str;
2057  str << type;
2058  return str.str();
2059 }
2060 
2061 /** Formatted output of the Pooling Type.
2062  *
2063  * @param[in] type Type to output.
2064  *
2065  * @return Formatted string.
2066  */
2067 inline std::string to_string(const PoolingType &type)
2068 {
2069  std::stringstream str;
2070  str << type;
2071  return str.str();
2072 }
2073 
2074 /** Formatted output of the Pooling Layer Info.
2075  *
2076  * @param[in] info Type to output.
2077  *
2078  * @return Formatted string.
2079  */
2080 inline std::string to_string(const PoolingLayerInfo &info)
2081 {
2082  std::stringstream str;
2083  str << "{Type=" << info.pool_type << ","
2084  << "DataLayout=" << info.data_layout << ","
2085  << "IsGlobalPooling=" << info.is_global_pooling;
2086  if(!info.is_global_pooling)
2087  {
2088  str << ","
2089  << "PoolSize=" << info.pool_size.width << "," << info.pool_size.height << ","
2090  << "PadStride=" << info.pad_stride_info;
2091  }
2092  str << "}";
2093  return str.str();
2094 }
2095 
2096 /** Formatted output of the Size3D type.
2097  *
2098  * @param[out] os Output stream
2099  * @param[in] size Type to output
2100  *
2101  * @return Modified output stream.
2102  */
2103 inline ::std::ostream &operator<<(::std::ostream &os, const Size3D &size)
2104 {
2105  os << size.width << "x" << size.height << "x" << size.depth;
2106 
2107  return os;
2108 }
2109 
2110 /** Formatted output of the Size3D type.
2111  *
2112  * @param[in] type Type to output
2113  *
2114  * @return Formatted string.
2115  */
2116 inline std::string to_string(const Size3D &type)
2117 {
2118  std::stringstream str;
2119  str << type;
2120  return str.str();
2121 }
2122 
2123 /** Formatted output of the Padding3D type.
2124  *
2125  * @param[out] os Output stream.
2126  * @param[in] padding3d Padding info for 3D spatial dimension shape.
2127  *
2128  * @return Modified output stream.
2129  */
2130 inline ::std::ostream &operator<<(::std::ostream &os, const Padding3D &padding3d)
2131 {
2132  os << padding3d.left << "," << padding3d.right << ","
2133  << padding3d.top << "," << padding3d.bottom << ","
2134  << padding3d.front << "," << padding3d.back;
2135  return os;
2136 }
2137 
2138 /** Converts a @ref Padding3D to string
2139  *
2140  * @param[in] padding3d Padding3D value to be converted
2141  *
2142  * @return String representing the corresponding Padding3D
2143  */
2144 inline std::string to_string(const Padding3D &padding3d)
2145 {
2146  std::stringstream str;
2147  str << padding3d;
2148  return str.str();
2149 }
2150 
2151 /** Formatted output of the DimensionRoundingType type.
2152  *
2153  * @param[out] os Output stream.
2154  * @param[in] rounding_type DimensionRoundingType Dimension rounding type when down-scaling, or compute output shape of pooling(2D or 3D).
2155  *
2156  * @return Modified output stream.
2157  */
2158 inline ::std::ostream &operator<<(::std::ostream &os, const DimensionRoundingType &rounding_type)
2159 {
2160  switch(rounding_type)
2161  {
2163  os << "CEIL";
2164  break;
2166  os << "FLOOR";
2167  break;
2168  default:
2169  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2170  }
2171  return os;
2172 }
2173 
2174 /** Formatted output of the Pooling 3d Layer Info.
2175  *
2176  * @param[out] os Output stream.
2177  * @param[in] info Pooling 3D layer info to print to output stream.
2178  *
2179  * @return Modified output stream.
2180  */
2181 inline ::std::ostream &operator<<(::std::ostream &os, const Pooling3dLayerInfo &info)
2182 {
2183  os << "{Type=" << info.pool_type << ","
2184  << "IsGlobalPooling=" << info.is_global_pooling;
2185  if(!info.is_global_pooling)
2186  {
2187  os << ","
2188  << "PoolSize=" << info.pool_size << ", "
2189  << "Stride=" << info.stride << ", "
2190  << "Padding=" << info.padding << ", "
2191  << "Exclude Padding=" << info.exclude_padding << ", "
2192  << "fp_mixed_precision=" << info.fp_mixed_precision << ", "
2193  << "DimensionRoundingType=" << info.round_type;
2194  }
2195  os << "}";
2196  return os;
2197 }
2198 
2199 /** Formatted output of the Pooling 3d Layer Info.
2200  *
2201  * @param[in] info Type to output.
2202  *
2203  * @return Formatted string.
2204  */
2205 inline std::string to_string(const Pooling3dLayerInfo &info)
2206 {
2207  std::stringstream str;
2208  str << info;
2209  return str.str();
2210 }
2211 
2212 /** Formatted output of the PriorBoxLayerInfo.
2213  *
2214  * @param[in] info Type to output.
2215  *
2216  * @return Formatted string.
2217  */
2218 inline std::string to_string(const PriorBoxLayerInfo &info)
2219 {
2220  std::stringstream str;
2221  str << "{";
2222  str << "Clip:" << info.clip()
2223  << "Flip:" << info.flip()
2224  << "StepX:" << info.steps()[0]
2225  << "StepY:" << info.steps()[1]
2226  << "MinSizes:" << info.min_sizes().size()
2227  << "MaxSizes:" << info.max_sizes().size()
2228  << "ImgSizeX:" << info.img_size().x
2229  << "ImgSizeY:" << info.img_size().y
2230  << "Offset:" << info.offset()
2231  << "Variances:" << info.variances().size();
2232  str << "}";
2233  return str.str();
2234 }
2235 
2236 /** Formatted output of the Size2D type.
2237  *
2238  * @param[out] os Output stream
2239  * @param[in] size Type to output
2240  *
2241  * @return Modified output stream.
2242  */
2243 inline ::std::ostream &operator<<(::std::ostream &os, const Size2D &size)
2244 {
2245  os << size.width << "x" << size.height;
2246 
2247  return os;
2248 }
2249 
2250 /** Formatted output of the Size2D type.
2251  *
2252  * @param[in] type Type to output
2253  *
2254  * @return Formatted string.
2255  */
2256 inline std::string to_string(const Size2D &type)
2257 {
2258  std::stringstream str;
2259  str << type;
2260  return str.str();
2261 }
2262 
2263 /** Formatted output of the ConvolutionMethod type.
2264  *
2265  * @param[out] os Output stream
2266  * @param[in] conv_method Type to output
2267  *
2268  * @return Modified output stream.
2269  */
2270 inline ::std::ostream &operator<<(::std::ostream &os, const ConvolutionMethod &conv_method)
2271 {
2272  switch(conv_method)
2273  {
2275  os << "GEMM";
2276  break;
2278  os << "DIRECT";
2279  break;
2281  os << "WINOGRAD";
2282  break;
2284  os << "FFT";
2285  break;
2287  os << "GEMM_CONV2D";
2288  break;
2289  default:
2290  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2291  }
2292 
2293  return os;
2294 }
2295 
2296 /** Formatted output of the ConvolutionMethod type.
2297  *
2298  * @param[in] conv_method Type to output
2299  *
2300  * @return Formatted string.
2301  */
2302 inline std::string to_string(const ConvolutionMethod &conv_method)
2303 {
2304  std::stringstream str;
2305  str << conv_method;
2306  return str.str();
2307 }
2308 
2309 /** Formatted output of the GPUTarget type.
2310  *
2311  * @param[out] os Output stream
2312  * @param[in] gpu_target Type to output
2313  *
2314  * @return Modified output stream.
2315  */
2316 inline ::std::ostream &operator<<(::std::ostream &os, const GPUTarget &gpu_target)
2317 {
2318  switch(gpu_target)
2319  {
2321  os << "GPU_ARCH_MASK";
2322  break;
2324  os << "GPU_GENERATION_MASK";
2325  break;
2326  case GPUTarget::MIDGARD:
2327  os << "MIDGARD";
2328  break;
2329  case GPUTarget::BIFROST:
2330  os << "BIFROST";
2331  break;
2332  case GPUTarget::VALHALL:
2333  os << "VALHALL";
2334  break;
2335  case GPUTarget::T600:
2336  os << "T600";
2337  break;
2338  case GPUTarget::T700:
2339  os << "T700";
2340  break;
2341  case GPUTarget::T800:
2342  os << "T800";
2343  break;
2344  case GPUTarget::G71:
2345  os << "G71";
2346  break;
2347  case GPUTarget::G72:
2348  os << "G72";
2349  break;
2350  case GPUTarget::G51:
2351  os << "G51";
2352  break;
2353  case GPUTarget::G51BIG:
2354  os << "G51BIG";
2355  break;
2356  case GPUTarget::G51LIT:
2357  os << "G51LIT";
2358  break;
2359  case GPUTarget::G31:
2360  os << "G31";
2361  break;
2362  case GPUTarget::G76:
2363  os << "G76";
2364  break;
2365  case GPUTarget::G52:
2366  os << "G52";
2367  break;
2368  case GPUTarget::G52LIT:
2369  os << "G52LIT";
2370  break;
2371  case GPUTarget::G77:
2372  os << "G77";
2373  break;
2374  case GPUTarget::G57:
2375  os << "G57";
2376  break;
2377  case GPUTarget::G78:
2378  os << "G78";
2379  break;
2380  case GPUTarget::G68:
2381  os << "G68";
2382  break;
2383  case GPUTarget::G78AE:
2384  os << "G78AE";
2385  break;
2386  case GPUTarget::G710:
2387  os << "G710";
2388  break;
2389  case GPUTarget::G610:
2390  os << "G610";
2391  break;
2392  case GPUTarget::G510:
2393  os << "G510";
2394  break;
2395  case GPUTarget::G310:
2396  os << "G310";
2397  break;
2398  case GPUTarget::G715:
2399  os << "G715";
2400  break;
2401  case GPUTarget::G615:
2402  os << "G615";
2403  break;
2404  default:
2405  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2406  }
2407 
2408  return os;
2409 }
2410 
2411 /** Formatted output of the GPUTarget type.
2412  *
2413  * @param[in] gpu_target Type to output
2414  *
2415  * @return Formatted string.
2416  */
2417 inline std::string to_string(const GPUTarget &gpu_target)
2418 {
2419  std::stringstream str;
2420  str << gpu_target;
2421  return str.str();
2422 }
2423 
2424 /** Formatted output of the DetectionWindow type.
2425  *
2426  * @param[out] os Output stream
2427  * @param[in] detection_window Type to output
2428  *
2429  * @return Modified output stream.
2430  */
2431 inline ::std::ostream &operator<<(::std::ostream &os, const DetectionWindow &detection_window)
2432 {
2433  os << "{x=" << detection_window.x << ","
2434  << "y=" << detection_window.y << ","
2435  << "width=" << detection_window.width << ","
2436  << "height=" << detection_window.height << ","
2437  << "idx_class=" << detection_window.idx_class << ","
2438  << "score=" << detection_window.score << "}";
2439 
2440  return os;
2441 }
2442 
2443 /** Formatted output of the DetectionOutputLayerCodeType type.
2444  *
2445  * @param[out] os Output stream
2446  * @param[in] detection_code Type to output
2447  *
2448  * @return Modified output stream.
2449  */
2450 inline ::std::ostream &operator<<(::std::ostream &os, const DetectionOutputLayerCodeType &detection_code)
2451 {
2452  switch(detection_code)
2453  {
2455  os << "CENTER_SIZE";
2456  break;
2458  os << "CORNER";
2459  break;
2461  os << "CORNER_SIZE";
2462  break;
2464  os << "TF_CENTER";
2465  break;
2466  default:
2467  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2468  }
2469 
2470  return os;
2471 }
2472 /** Formatted output of the DetectionOutputLayerCodeType type.
2473  *
2474  * @param[in] detection_code Type to output
2475  *
2476  * @return Formatted string.
2477  */
2478 inline std::string to_string(const DetectionOutputLayerCodeType &detection_code)
2479 {
2480  std::stringstream str;
2481  str << detection_code;
2482  return str.str();
2483 }
2484 
2485 /** Formatted output of the DetectionOutputLayerInfo type.
2486  *
2487  * @param[out] os Output stream
2488  * @param[in] detection_info Type to output
2489  *
2490  * @return Modified output stream.
2491  */
2492 inline ::std::ostream &operator<<(::std::ostream &os, const DetectionOutputLayerInfo &detection_info)
2493 {
2494  os << "{Classes=" << detection_info.num_classes() << ","
2495  << "ShareLocation=" << detection_info.share_location() << ","
2496  << "CodeType=" << detection_info.code_type() << ","
2497  << "VarianceEncodedInTarget=" << detection_info.variance_encoded_in_target() << ","
2498  << "KeepTopK=" << detection_info.keep_top_k() << ","
2499  << "NMSThreshold=" << detection_info.nms_threshold() << ","
2500  << "Eta=" << detection_info.eta() << ","
2501  << "BackgroundLabelId=" << detection_info.background_label_id() << ","
2502  << "ConfidenceThreshold=" << detection_info.confidence_threshold() << ","
2503  << "TopK=" << detection_info.top_k() << ","
2504  << "NumLocClasses=" << detection_info.num_loc_classes()
2505  << "}";
2506 
2507  return os;
2508 }
2509 
2510 /** Formatted output of the DetectionOutputLayerInfo type.
2511  *
2512  * @param[in] detection_info Type to output
2513  *
2514  * @return Formatted string.
2515  */
2516 inline std::string to_string(const DetectionOutputLayerInfo &detection_info)
2517 {
2518  std::stringstream str;
2519  str << detection_info;
2520  return str.str();
2521 }
2522 /** Formatted output of the DetectionPostProcessLayerInfo type.
2523  *
2524  * @param[out] os Output stream
2525  * @param[in] detection_info Type to output
2526  *
2527  * @return Modified output stream.
2528  */
2529 inline ::std::ostream &operator<<(::std::ostream &os, const DetectionPostProcessLayerInfo &detection_info)
2530 {
2531  os << "{MaxDetections=" << detection_info.max_detections() << ","
2532  << "MaxClassesPerDetection=" << detection_info.max_classes_per_detection() << ","
2533  << "NmsScoreThreshold=" << detection_info.nms_score_threshold() << ","
2534  << "NmsIouThreshold=" << detection_info.iou_threshold() << ","
2535  << "NumClasses=" << detection_info.num_classes() << ","
2536  << "ScaleValue_y=" << detection_info.scale_value_y() << ","
2537  << "ScaleValue_x=" << detection_info.scale_value_x() << ","
2538  << "ScaleValue_h=" << detection_info.scale_value_h() << ","
2539  << "ScaleValue_w=" << detection_info.scale_value_w() << ","
2540  << "UseRegularNms=" << detection_info.use_regular_nms() << ","
2541  << "DetectionPerClass=" << detection_info.detection_per_class()
2542  << "}";
2543 
2544  return os;
2545 }
2546 
2547 /** Formatted output of the DetectionPostProcessLayerInfo type.
2548  *
2549  * @param[in] detection_info Type to output
2550  *
2551  * @return Formatted string.
2552  */
2553 inline std::string to_string(const DetectionPostProcessLayerInfo &detection_info)
2554 {
2555  std::stringstream str;
2556  str << detection_info;
2557  return str.str();
2558 }
2559 
2560 /** Formatted output of the DetectionWindow type.
2561  *
2562  * @param[in] detection_window Type to output
2563  *
2564  * @return Formatted string.
2565  */
2566 inline std::string to_string(const DetectionWindow &detection_window)
2567 {
2568  std::stringstream str;
2569  str << detection_window;
2570  return str.str();
2571 }
2572 
2573 /** Formatted output of @ref PriorBoxLayerInfo.
2574  *
2575  * @param[out] os Output stream.
2576  * @param[in] info Type to output.
2577  *
2578  * @return Modified output stream.
2579  */
2580 inline ::std::ostream &operator<<(::std::ostream &os, const PriorBoxLayerInfo &info)
2581 {
2582  os << "Clip:" << info.clip()
2583  << "Flip:" << info.flip()
2584  << "StepX:" << info.steps()[0]
2585  << "StepY:" << info.steps()[1]
2586  << "MinSizes:" << info.min_sizes()
2587  << "MaxSizes:" << info.max_sizes()
2588  << "ImgSizeX:" << info.img_size().x
2589  << "ImgSizeY:" << info.img_size().y
2590  << "Offset:" << info.offset()
2591  << "Variances:" << info.variances();
2592 
2593  return os;
2594 }
2595 
2596 /** Formatted output of the WinogradInfo type. */
2597 inline ::std::ostream &operator<<(::std::ostream &os, const WinogradInfo &info)
2598 {
2599  os << "{OutputTileSize=" << info.output_tile_size << ","
2600  << "KernelSize=" << info.kernel_size << ","
2601  << "PadStride=" << info.convolution_info << ","
2602  << "OutputDataLayout=" << info.output_data_layout << "}";
2603 
2604  return os;
2605 }
2606 
2607 inline std::string to_string(const WinogradInfo &type)
2608 {
2609  std::stringstream str;
2610  str << type;
2611  return str.str();
2612 }
2613 
2614 /** Convert a CLTunerMode value to a string
2615  *
2616  * @param val CLTunerMode value to be converted
2617  *
2618  * @return String representing the corresponding CLTunerMode.
2619  */
2620 inline std::string to_string(const CLTunerMode val)
2621 {
2622  switch(val)
2623  {
2625  {
2626  return std::string("Exhaustive");
2627  }
2628  case CLTunerMode::NORMAL:
2629  {
2630  return std::string("Normal");
2631  }
2632  case CLTunerMode::RAPID:
2633  {
2634  return std::string("Rapid");
2635  }
2636  default:
2637  {
2638  ARM_COMPUTE_ERROR("Invalid tuner mode.");
2639  return std::string("UNDEFINED");
2640  }
2641  }
2642 }
2643 /** Converts a @ref CLGEMMKernelType to string
2644  *
2645  * @param[in] val CLGEMMKernelType value to be converted
2646  *
2647  * @return String representing the corresponding CLGEMMKernelType
2648  */
2649 inline std::string to_string(CLGEMMKernelType val)
2650 {
2651  switch(val)
2652  {
2654  {
2655  return "Native";
2656  }
2658  {
2659  return "Reshaped_Only_RHS";
2660  }
2662  {
2663  return "Reshaped";
2664  }
2665  default:
2666  {
2667  return "Unknown";
2668  }
2669  }
2670 }
2671 /** [Print CLTunerMode type] **/
2672 /** Formatted output of the CLTunerMode type.
2673  *
2674  * @param[out] os Output stream.
2675  * @param[in] val CLTunerMode to output.
2676  *
2677  * @return Modified output stream.
2678  */
2679 inline ::std::ostream &operator<<(::std::ostream &os, const CLTunerMode &val)
2680 {
2681  os << to_string(val);
2682  return os;
2683 }
2684 
2685 /** Formatted output of the ConvolutionInfo type.
2686  *
2687  * @param[out] os Output stream.
2688  * @param[in] conv_info ConvolutionInfo to output.
2689  *
2690  * @return Modified output stream.
2691  */
2692 inline ::std::ostream &operator<<(::std::ostream &os, const ConvolutionInfo &conv_info)
2693 {
2694  os << "{PadStrideInfo=" << conv_info.pad_stride_info << ", "
2695  << "depth_multiplier=" << conv_info.depth_multiplier << ", "
2696  << "act_info=" << to_string(conv_info.act_info) << ", "
2697  << "dilation=" << conv_info.dilation << "}";
2698  return os;
2699 }
2700 
2701 /** Converts a @ref ConvolutionInfo to string
2702  *
2703  * @param[in] info ConvolutionInfo value to be converted
2704  *
2705  * @return String representing the corresponding ConvolutionInfo
2706  */
2707 inline std::string to_string(const ConvolutionInfo &info)
2708 {
2709  std::stringstream str;
2710  str << info;
2711  return str.str();
2712 }
2713 
2714 /** Formatted output of the FullyConnectedLayerInfo type.
2715  *
2716  * @param[out] os Output stream.
2717  * @param[in] layer_info FullyConnectedLayerInfo to output.
2718  *
2719  * @return Modified output stream.
2720  */
2721 inline ::std::ostream &operator<<(::std::ostream &os, const FullyConnectedLayerInfo &layer_info)
2722 {
2723  os << "{activation_info=" << to_string(layer_info.activation_info) << ", "
2724  << "weights_trained_layout=" << layer_info.weights_trained_layout << ", "
2725  << "transpose_weights=" << layer_info.transpose_weights << ", "
2726  << "are_weights_reshaped=" << layer_info.are_weights_reshaped << ", "
2727  << "retain_internal_weights=" << layer_info.retain_internal_weights << ", "
2728  << "constant_weights=" << layer_info.transpose_weights << ", "
2729  << "fp_mixed_precision=" << layer_info.fp_mixed_precision << "}";
2730  return os;
2731 }
2732 
2733 /** Converts a @ref FullyConnectedLayerInfo to string
2734  *
2735  * @param[in] info FullyConnectedLayerInfo value to be converted
2736  *
2737  * @return String representing the corresponding FullyConnectedLayerInfo
2738  */
2739 inline std::string to_string(const FullyConnectedLayerInfo &info)
2740 {
2741  std::stringstream str;
2742  str << info;
2743  return str.str();
2744 }
2745 
2746 /** Formatted output of the GEMMLowpOutputStageType type.
2747  *
2748  * @param[out] os Output stream.
2749  * @param[in] gemm_type GEMMLowpOutputStageType to output.
2750  *
2751  * @return Modified output stream.
2752  */
2753 inline ::std::ostream &operator<<(::std::ostream &os, const GEMMLowpOutputStageType &gemm_type)
2754 {
2755  switch(gemm_type)
2756  {
2758  os << "NONE";
2759  break;
2761  os << "QUANTIZE_DOWN";
2762  break;
2764  os << "QUANTIZE_DOWN_FIXEDPOINT";
2765  break;
2767  os << "QUANTIZE_DOWN_FLOAT";
2768  break;
2769  default:
2770  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2771  }
2772  return os;
2773 }
2774 
2775 /** Converts a @ref GEMMLowpOutputStageType to string
2776  *
2777  * @param[in] gemm_type GEMMLowpOutputStageType value to be converted
2778  *
2779  * @return String representing the corresponding GEMMLowpOutputStageType
2780  */
2781 inline std::string to_string(const GEMMLowpOutputStageType &gemm_type)
2782 {
2783  std::stringstream str;
2784  str << gemm_type;
2785  return str.str();
2786 }
2787 
2788 /** Formatted output of the GEMMLowpOutputStageInfo type.
2789  *
2790  * @param[out] os Output stream.
2791  * @param[in] gemm_info GEMMLowpOutputStageInfo to output.
2792  *
2793  * @return Modified output stream.
2794  */
2795 inline ::std::ostream &operator<<(::std::ostream &os, const GEMMLowpOutputStageInfo &gemm_info)
2796 {
2797  os << "{type=" << gemm_info.type << ", "
2798  << "gemlowp_offset=" << gemm_info.gemmlowp_offset << ", "
2799  << "gemmlowp_multiplier=" << gemm_info.gemmlowp_multiplier << ", "
2800  << "gemmlowp_shift=" << gemm_info.gemmlowp_shift << ", "
2801  << "gemmlowp_min_bound=" << gemm_info.gemmlowp_min_bound << ", "
2802  << "gemmlowp_max_bound=" << gemm_info.gemmlowp_max_bound << ", "
2803  << "gemmlowp_multipliers=" << gemm_info.gemmlowp_multiplier << ", "
2804  << "gemmlowp_shifts=" << gemm_info.gemmlowp_shift << ", "
2805  << "gemmlowp_real_multiplier=" << gemm_info.gemmlowp_real_multiplier << ", "
2806  << "is_quantized_per_channel=" << gemm_info.is_quantized_per_channel << ", "
2807  << "output_data_type=" << gemm_info.output_data_type << "}";
2808  return os;
2809 }
2810 
2811 /** Converts a @ref GEMMLowpOutputStageInfo to string
2812  *
2813  * @param[in] gemm_info GEMMLowpOutputStageInfo value to be converted
2814  *
2815  * @return String representing the corresponding GEMMLowpOutputStageInfo
2816  */
2817 inline std::string to_string(const GEMMLowpOutputStageInfo &gemm_info)
2818 {
2819  std::stringstream str;
2820  str << gemm_info;
2821  return str.str();
2822 }
2823 
2824 /** Formatted output of the Conv2dInfo type.
2825  *
2826  * @param[out] os Output stream.
2827  * @param[in] conv_info Conv2dInfo to output.
2828  *
2829  * @return Modified output stream.
2830  */
2831 inline ::std::ostream &operator<<(::std::ostream &os, const Conv2dInfo &conv_info)
2832 {
2833  os << "{conv_info=" << conv_info.conv_info << ", "
2834  << "dilation=" << conv_info.dilation << ", "
2835  << "act_info=" << to_string(conv_info.act_info) << ", "
2836  << "enable_fast_math=" << conv_info.enable_fast_math << ", "
2837  << "num_groups=" << conv_info.num_groups << ","
2838  << "post_ops=" << conv_info.post_ops << "}";
2839  return os;
2840 }
2841 
2842 /** Converts a @ref Conv2dInfo to string
2843  *
2844  * @param[in] conv_info Conv2dInfo value to be converted
2845  *
2846  * @return String representing the corresponding Conv2dInfo
2847  */
2848 inline std::string to_string(const Conv2dInfo &conv_info)
2849 {
2850  std::stringstream str;
2851  str << conv_info;
2852  return str.str();
2853 }
2854 
2855 /** Formatted output of the PixelValue type.
2856  *
2857  * @param[out] os Output stream.
2858  * @param[in] pixel_value PixelValue to output.
2859  *
2860  * @return Modified output stream.
2861  */
2862 inline ::std::ostream &operator<<(::std::ostream &os, const PixelValue &pixel_value)
2863 {
2864  os << "{value.u64=" << pixel_value.get<uint64_t>() << "}";
2865  return os;
2866 }
2867 
2868 /** Converts a @ref PixelValue to string
2869  *
2870  * @param[in] pixel_value PixelValue value to be converted
2871  *
2872  * @return String representing the corresponding PixelValue
2873  */
2874 inline std::string to_string(const PixelValue &pixel_value)
2875 {
2876  std::stringstream str;
2877  str << pixel_value;
2878  return str.str();
2879 }
2880 
2881 /** Formatted output of the ScaleKernelInfo type.
2882  *
2883  * @param[out] os Output stream.
2884  * @param[in] scale_info ScaleKernelInfo to output.
2885  *
2886  * @return Modified output stream.
2887  */
2888 inline ::std::ostream &operator<<(::std::ostream &os, const ScaleKernelInfo &scale_info)
2889 {
2890  os << "{interpolation_policy=" << scale_info.interpolation_policy << ", "
2891  << "BorderMode=" << scale_info.border_mode << ", "
2892  << "PixelValue=" << scale_info.constant_border_value << ", "
2893  << "SamplingPolicy=" << scale_info.sampling_policy << ", "
2894  << "use_padding=" << scale_info.use_padding << ", "
2895  << "align_corners=" << scale_info.align_corners << ", "
2896  << "data_layout=" << scale_info.data_layout << "}";
2897  return os;
2898 }
2899 
2900 /** Converts a @ref ScaleKernelInfo to string
2901  *
2902  * @param[in] scale_info ScaleKernelInfo value to be converted
2903  *
2904  * @return String representing the corresponding ScaleKernelInfo
2905  */
2906 inline std::string to_string(const ScaleKernelInfo &scale_info)
2907 {
2908  std::stringstream str;
2909  str << scale_info;
2910  return str.str();
2911 }
2912 
2913 /** Formatted output of the FFTDirection type.
2914  *
2915  * @param[out] os Output stream.
2916  * @param[in] fft_dir FFTDirection to output.
2917  *
2918  * @return Modified output stream.
2919  */
2920 inline ::std::ostream &operator<<(::std::ostream &os, const FFTDirection &fft_dir)
2921 {
2922  switch(fft_dir)
2923  {
2924  case FFTDirection::Forward:
2925  os << "Forward";
2926  break;
2927  case FFTDirection::Inverse:
2928  os << "Inverse";
2929  break;
2930  default:
2931  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2932  }
2933  return os;
2934 }
2935 
2936 /** Converts a @ref FFT1DInfo to string
2937  *
2938  * @param[in] fft_dir FFT1DInfo value to be converted
2939  *
2940  * @return String representing the corresponding FFT1DInfo
2941  */
2942 inline std::string to_string(const FFTDirection &fft_dir)
2943 {
2944  std::stringstream str;
2945  str << "{" << fft_dir << "}";
2946  return str.str();
2947 }
2948 
2949 /** Formatted output of the FFT1DInfo type.
2950  *
2951  * @param[out] os Output stream.
2952  * @param[in] fft1d_info FFT1DInfo to output.
2953  *
2954  * @return Modified output stream.
2955  */
2956 inline ::std::ostream &operator<<(::std::ostream &os, const FFT1DInfo &fft1d_info)
2957 {
2958  os << "{axis=" << fft1d_info.axis << ", "
2959  << "direction=" << fft1d_info.direction << "}";
2960  return os;
2961 }
2962 
2963 /** Converts a @ref FFT1DInfo to string
2964  *
2965  * @param[in] fft1d_info FFT1DInfo value to be converted
2966  *
2967  * @return String representing the corresponding FFT1DInfo
2968  */
2969 inline std::string to_string(const FFT1DInfo &fft1d_info)
2970 {
2971  std::stringstream str;
2972  str << fft1d_info;
2973  return str.str();
2974 }
2975 
2976 /** Formatted output of the FFT2DInfo type.
2977  *
2978  * @param[out] os Output stream.
2979  * @param[in] fft2d_info FFT2DInfo to output.
2980  *
2981  * @return Modified output stream.
2982  */
2983 inline ::std::ostream &operator<<(::std::ostream &os, const FFT2DInfo &fft2d_info)
2984 {
2985  os << "{axis=" << fft2d_info.axis0 << ", "
2986  << "axis=" << fft2d_info.axis1 << ", "
2987  << "direction=" << fft2d_info.direction << "}";
2988  return os;
2989 }
2990 
2991 /** Converts a @ref FFT2DInfo to string
2992  *
2993  * @param[in] fft2d_info FFT2DInfo value to be converted
2994  *
2995  * @return String representing the corresponding FFT2DInfo
2996  */
2997 inline std::string to_string(const FFT2DInfo &fft2d_info)
2998 {
2999  std::stringstream str;
3000  str << fft2d_info;
3001  return str.str();
3002 }
3003 
3004 /** Formatted output of the Coordinates2D type.
3005  *
3006  * @param[out] os Output stream.
3007  * @param[in] coord_2d Coordinates2D to output.
3008  *
3009  * @return Modified output stream.
3010  */
3011 inline ::std::ostream &operator<<(::std::ostream &os, const Coordinates2D &coord_2d)
3012 {
3013  os << "{x=" << coord_2d.x << ", "
3014  << "y=" << coord_2d.y << "}";
3015  return os;
3016 }
3017 
3018 /** Converts a @ref Coordinates2D to string
3019  *
3020  * @param[in] coord_2d Coordinates2D value to be converted
3021  *
3022  * @return String representing the corresponding Coordinates2D
3023  */
3024 inline std::string to_string(const Coordinates2D &coord_2d)
3025 {
3026  std::stringstream str;
3027  str << coord_2d;
3028  return str.str();
3029 }
3030 
3031 /** Formatted output of the FuseBatchNormalizationType type.
3032  *
3033  * @param[out] os Output stream.
3034  * @param[in] fuse_type FuseBatchNormalizationType to output.
3035  *
3036  * @return Modified output stream.
3037  */
3038 inline ::std::ostream &operator<<(::std::ostream &os, const FuseBatchNormalizationType &fuse_type)
3039 {
3040  switch(fuse_type)
3041  {
3043  os << "CONVOLUTION";
3044  break;
3046  os << "DEPTHWISECONVOLUTION";
3047  break;
3048  default:
3049  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
3050  }
3051  return os;
3052 }
3053 
3054 /** Converts a @ref FuseBatchNormalizationType to string
3055  *
3056  * @param[in] fuse_type FuseBatchNormalizationType value to be converted
3057  *
3058  * @return String representing the corresponding FuseBatchNormalizationType
3059  */
3060 inline std::string to_string(const FuseBatchNormalizationType &fuse_type)
3061 {
3062  std::stringstream str;
3063  str << fuse_type;
3064  return str.str();
3065 }
3066 
3067 /** Formatted output of the SoftmaxKernelInfo type.
3068  *
3069  * @param[out] os Output stream.
3070  * @param[in] info SoftmaxKernelInfo to output.
3071  *
3072  * @return Modified output stream.
3073  */
3074 inline ::std::ostream &operator<<(::std::ostream &os, const SoftmaxKernelInfo &info)
3075 {
3076  os << "{beta=" << info.beta << ", "
3077  << "is_log=" << info.is_log << ", "
3078  << "input_data_type=" << info.input_data_type << ", "
3079  << "axis=" << info.axis << "}";
3080  return os;
3081 }
3082 
3083 /** Converts a @ref SoftmaxKernelInfo to string
3084  *
3085  * @param[in] info SoftmaxKernelInfo value to be converted
3086  *
3087  * @return String representing the corresponding SoftmaxKernelInfo
3088  */
3089 inline std::string to_string(const SoftmaxKernelInfo &info)
3090 {
3091  std::stringstream str;
3092  str << info;
3093  return str.str();
3094 }
3095 
3096 /** Formatted output of the ScaleKernelInfo type.
3097  *
3098  * @param[out] os Output stream.
3099  * @param[in] lstm_params LSTMParams to output.
3100  *
3101  * @return Modified output stream.
3102  */
3103 template <typename T>
3104 ::std::ostream &operator<<(::std::ostream &os, const LSTMParams<T> &lstm_params)
3105 {
3106  os << "{input_to_input_weights=" << to_string(lstm_params.input_to_input_weights()) << ", "
3107  << "recurrent_to_input_weights=" << to_string(lstm_params.recurrent_to_input_weights()) << ", "
3108  << "cell_to_input_weights=" << to_string(lstm_params.cell_to_input_weights()) << ", "
3109  << "input_gate_bias=" << to_string(lstm_params.input_gate_bias()) << ", "
3110  << "cell_to_forget_weights=" << to_string(lstm_params.cell_to_forget_weights()) << ", "
3111  << "cell_to_output_weights=" << to_string(lstm_params.cell_to_output_weights()) << ", "
3112  << "projection_weights=" << to_string(lstm_params.projection_weights()) << ", "
3113  << "projection_bias=" << to_string(lstm_params.projection_bias()) << ", "
3114  << "input_layer_norm_weights=" << to_string(lstm_params.input_layer_norm_weights()) << ", "
3115  << "forget_layer_norm_weights=" << to_string(lstm_params.forget_layer_norm_weights()) << ", "
3116  << "cell_layer_norm_weights=" << to_string(lstm_params.cell_layer_norm_weights()) << ", "
3117  << "output_layer_norm_weights=" << to_string(lstm_params.output_layer_norm_weights()) << ", "
3118  << "cell_clip=" << lstm_params.cell_clip() << ", "
3119  << "projection_clip=" << lstm_params.projection_clip() << ", "
3120  << "input_intermediate_scale=" << lstm_params.input_intermediate_scale() << ", "
3121  << "forget_intermediate_scale=" << lstm_params.forget_intermediate_scale() << ", "
3122  << "cell_intermediate_scale=" << lstm_params.cell_intermediate_scale() << ", "
3123  << "hidden_state_zero=" << lstm_params.hidden_state_zero() << ", "
3124  << "hidden_state_scale=" << lstm_params.hidden_state_scale() << ", "
3125  << "has_peephole_opt=" << lstm_params.has_peephole_opt() << ", "
3126  << "has_projection=" << lstm_params.has_projection() << ", "
3127  << "has_cifg_opt=" << lstm_params.has_cifg_opt() << ", "
3128  << "use_layer_norm=" << lstm_params.use_layer_norm() << "}";
3129  return os;
3130 }
3131 
3132 /** Converts a @ref LSTMParams to string
3133  *
3134  * @param[in] lstm_params LSTMParams<T> value to be converted
3135  *
3136  * @return String representing the corresponding LSTMParams
3137  */
3138 template <typename T>
3139 std::string to_string(const LSTMParams<T> &lstm_params)
3140 {
3141  std::stringstream str;
3142  str << lstm_params;
3143  return str.str();
3144 }
3145 
3146 /** Converts a @ref LSTMParams to string
3147  *
3148  * @param[in] num uint8_t value to be converted
3149  *
3150  * @return String representing the corresponding uint8_t
3151  */
3152 inline std::string to_string(const uint8_t num)
3153 {
3154  // Explicity cast the uint8_t to signed integer and call the corresponding overloaded to_string() function.
3155  return ::std::to_string(static_cast<int>(num));
3156 }
3157 
3158 /** Available non maxima suppression types */
3159 /** Formatted output of the NMSType type.
3160  *
3161  * @param[out] os Output stream.
3162  * @param[in] nms_type NMSType to output.
3163  *
3164  * @return Modified output stream.
3165  */
3166 inline ::std::ostream &operator<<(::std::ostream &os, const NMSType &nms_type)
3167 {
3168  switch(nms_type)
3169  {
3170  case NMSType::LINEAR:
3171  os << "LINEAR";
3172  break;
3173  case NMSType::GAUSSIAN:
3174  os << "GAUSSIAN";
3175  break;
3176  case NMSType::ORIGINAL:
3177  os << "ORIGINAL";
3178  break;
3179  default:
3180  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
3181  }
3182  return os;
3183 }
3184 
3185 /** Converts a @ref NMSType to string
3186  *
3187  * @param[in] nms_type NMSType value to be converted
3188  *
3189  * @return String representing the corresponding NMSType
3190  */
3191 inline std::string to_string(const NMSType nms_type)
3192 {
3193  std::stringstream str;
3194  str << nms_type;
3195  return str.str();
3196 }
3197 
3198 /** Formatted output of the BoxNMSLimitInfo type.
3199  *
3200  * @param[out] os Output stream.
3201  * @param[in] info BoxNMSLimitInfo to output.
3202  *
3203  * @return Modified output stream.
3204  */
3205 inline ::std::ostream &operator<<(::std::ostream &os, const BoxNMSLimitInfo &info)
3206 {
3207  os << "{score_thresh=" << info.score_thresh() << ", "
3208  << "nms=" << info.nms() << ", "
3209  << "detections_per_im=" << info.detections_per_im() << ", "
3210  << "soft_nms_enabled=" << info.soft_nms_enabled() << ", "
3211  << "soft_nms_min_score_thres=" << info.soft_nms_min_score_thres() << ", "
3212  << "suppress_size=" << info.suppress_size() << ", "
3213  << "min_size=" << info.min_size() << ", "
3214  << "im_width=" << info.im_width() << ", "
3215  << "im_height=" << info.im_height() << "}";
3216  return os;
3217 }
3218 
3219 /** Converts a @ref BoxNMSLimitInfo to string
3220  *
3221  * @param[in] info BoxNMSLimitInfo value to be converted
3222  *
3223  * @return String representing the corresponding BoxNMSLimitInfo
3224  */
3225 inline std::string to_string(const BoxNMSLimitInfo &info)
3226 {
3227  std::stringstream str;
3228  str << info;
3229  return str.str();
3230 }
3231 
3232 /** Converts a @ref DimensionRoundingType to string
3233  *
3234  * @param[in] rounding_type DimensionRoundingType value to be converted
3235  *
3236  * @return String representing the corresponding DimensionRoundingType
3237  */
3238 inline std::string to_string(const DimensionRoundingType &rounding_type)
3239 {
3240  std::stringstream str;
3241  str << rounding_type;
3242  return str.str();
3243 }
3244 
3245 /** Formatted output of the Conv3dInfo type.
3246  *
3247  * @param[out] os Output stream.
3248  * @param[in] conv3d_info Type to output.
3249  *
3250  * @return Modified output stream.
3251  */
3252 inline ::std::ostream &operator<<(::std::ostream &os, const Conv3dInfo &conv3d_info)
3253 {
3254  os << conv3d_info.stride;
3255  os << ";";
3256  os << conv3d_info.padding;
3257  os << ";";
3258  os << to_string(conv3d_info.act_info);
3259  os << ";";
3260  os << conv3d_info.dilation;
3261  os << ";";
3262  os << conv3d_info.round_type;
3263  os << ";";
3264  os << conv3d_info.enable_fast_math;
3265 
3266  return os;
3267 }
3268 
3269 /** Formatted output of the Conv3dInfo type.
3270  *
3271  * @param[in] conv3d_info Type to output.
3272  *
3273  * @return Formatted string.
3274  */
3275 inline std::string to_string(const Conv3dInfo &conv3d_info)
3276 {
3277  std::stringstream str;
3278  str << conv3d_info;
3279  return str.str();
3280 }
3281 
3282 /** Formatted output of the arm_compute::WeightFormat type.
3283  *
3284  * @param[in] wf arm_compute::WeightFormat Type to output.
3285  *
3286  * @return Formatted string.
3287  */
3288 inline std::string to_string(const WeightFormat wf)
3289 {
3290 #define __CASE_WEIGHT_FORMAT(wf) \
3291 case WeightFormat::wf: \
3292  return #wf;
3293  switch(wf)
3294  {
3331  default:
3332  return "invalid value";
3333  }
3334 #undef __CASE_WEIGHT_FORMAT
3335 }
3336 
3337 /** Formatted output of the arm_compute::WeightFormat type.
3338  *
3339  * @param[out] os Output stream.
3340  * @param[in] wf WeightFormat to output.
3341  *
3342  * @return Modified output stream.
3343  */
3344 inline ::std::ostream &operator<<(::std::ostream &os, const arm_compute::WeightFormat &wf)
3345 {
3346  os << to_string(wf);
3347  return os;
3348 }
3349 
3350 /** Formatted output of the std::tuple<TensorShape, TensorShape, arm_compute::WeightFormat> tuple.
3351  *
3352  * @param[in] values tuple of input and output tensor shapes and WeightFormat used.
3353  *
3354  * @return Formatted string.
3355  */
3356 inline std::string to_string(const std::tuple<TensorShape, TensorShape, arm_compute::WeightFormat> values)
3357 {
3358  std::stringstream str;
3359  str << "[Input shape = " << std::get<0>(values);
3360  str << ", ";
3361  str << "Expected output shape = " << std::get<1>(values);
3362 
3363  str << ", ";
3364  str << "WeightFormat = " << std::get<2>(values) << "]";
3365  return str.str();
3366 }
3367 
3368 } // namespace arm_compute
3369 
3370 #endif /* __ARM_COMPUTE_TYPE_PRINTER_H__ */
BorderMode
Methods available to handle borders.
Definition: Types.h:274
Rectangle type.
Definition: Types.h:426
bool is_data_type_quantized(DataType dt)
Check if a given data type is of quantized type.
Definition: Utils.h:1030
const std::vector< int32_t > & offset() const
Offset vector accessor.
BorderMode border_mode
Border mode policy.
unsigned int top
top of the border
Definition: Types.h:390
std::string to_string(const std::tuple< TensorShape, TensorShape, arm_compute::WeightFormat > values)
Formatted output of the std::tuple<TensorShape, TensorShape, arm_compute::WeightFormat> tuple...
Definition: TypePrinter.h:3356
Class describing the value of a pixel for any image format.
Definition: PixelValue.h:34
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:489
InterpolationPolicy
Interpolation method.
Definition: Types.h:411
int num_classes() const
Get num classes.
Definition: Types.h:997
int mult_interleave4x4_height() const
Multiplication factor for the height of the 4x4 interleaved block.
Definition: Types.h:2154
int mult_interleave4x4_height
Multiplication factor for the height of the 4x4 interleaved block.
int32_t gemmlowp_multiplier
GEMMLowp output stage multiplier used for quantizing to QASYMM8.
Definition: Types.h:2224
Generate Proposals Information class.
Definition: Types.h:1427
Second channel (used by formats with unknown channel types).
unsigned int axis
Axis to run the FFT on.
Shape of a tensor.
Definition: TensorShape.h:39
FFTDirection direction
Direction of the FFT.
Quantize using a fixed point multiplication.
experimental::PostOpList< ITensorInfo * > post_ops
bool share_location() const
Get share location.
Definition: Types.h:1002
float im_width() const
Get image width (NMS may suppress boxes whose center sits beyond the image width) ...
Definition: Types.h:644
Descriptor used by the 3d Convolution function.
float scale_value_x() const
Get x scale value.
Definition: Types.h:1150
float score_thresh() const
Get the score threshold.
Definition: Types.h:599
DataLayout output_data_layout
Data layout to use for the output tensor once the convolution has been applied (NCHW or NHWC) ...
Definition: Types.h:2569
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.
InterpolationPolicy interpolation_policy
Interpolation type to use.
uint16_t x
Top-left x coordinate.
Definition: Types.h:539
float score
Confidence value for the detection window.
Definition: Types.h:544
bool enabled() const
Check if initialised.
Definition: Types.h:1678
std::vector< PaddingInfo > PaddingList
List of padding information.
Definition: Types.h:453
ReductionOperation
Available reduction operations.
Definition: Types.h:476
Container for 2D border size.
Definition: Types.h:282
bool retain_internal_weights
Retain internal reshaped weights.
Definition: Types.h:1750
unsigned int max_detections() const
Get max detections.
Definition: Types.h:1109
ActivationLayerInfo act_info
Brain floating point representation class.
Definition: Bfloat16.h:81
Cr/V/Value channel.
unsigned int v0
Number of vertical blocks of size (m0xk0) stored on the same output row.
Definition: Types.h:2245
#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:107
float beta
A scaling factor for the exponent with default value 1.0.
unsigned int depth_output_gemm3d
Depth of the output tensor in case is reinterpreted as 3D.
DataLayoutDimension
[DataLayout enum definition]
Definition: Types.h:124
Descriptor used by the FFT1D function.
Descriptor used by the FFT2D function.
BoxWithNonMaximaSuppressionLimit Information class.
Definition: Types.h:573
Winograd information.
Definition: Types.h:2550
uint32_t norm_size() const
Get the normalization size.
Definition: Types.h:1803
1 channel, 1 U8 per channel
NormType type() const
Get the normalization type.
Definition: Types.h:1798
int mult_transpose1xW_width() const
Multiplication factor for the width of the 1xW transposed block.
Definition: Types.h:2146
float a() const
Get the alpha value.
Definition: Types.h:1668
GEMM reshape information class.
Definition: Types.h:2092
PadStrideInfo convolution_info
Convolution info (Pads, strides,...)
Definition: Types.h:2568
void get(uint8_t &v) const
Interpret the pixel value as a U8.
Definition: PixelValue.h:244
PostOpType
Type of Post Op.
Definition: IPostOp.h:36
std::string to_string(T &&value)
Convert integer and float values to string.
An elementwise n-ary operation that can be appended to and fused with (at kernel-level) other operato...
Definition: IPostOp.h:89
virtual DataType data_type() const =0
Data type used for each element of the tensor.
Class for specifying the size of a 3D shape or object.
Definition: Size3D.h:32
bool are_reshaped() const
Flag which specifies if the weights tensor has been reshaped.
Definition: Types.h:2032
1 channel, 1 F32 per channel
DimensionRoundingType
Dimension rounding type when down-scaling on CNNs.
Definition: Types.h:550
Searches a subset of LWS configurations while tuning.
Normalization Layer Information class.
Definition: Types.h:1780
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:2260
GEMMType gemm_type(TokenStream &in, bool &valid)
Definition: MLGOParser.cpp:567
Fully connected layer info.
Definition: Types.h:1742
bool align_corners
Align corners of input and output.
bool fp_mixed_precision() const
Flag which specifies if a wider accumulator should be used.
Definition: Types.h:2406
GEMM LHS (Left Hand Side) matrix information.
Definition: Types.h:2236
Store the tensor&#39;s metadata.
Definition: ITensorInfo.h:40
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:79
quantized, asymmetric fixed-point 16-bit number
1 channel, 1 U16 per channel
unsigned int bottom
bottom of the border
Definition: Types.h:392
WeightFormat
Memory layouts for the weights tensor.
Definition: Types.h:1948
Reshaped GEMM kernel where only the rhs matrix is reshaped.
int32_t gemmlowp_offset
GEMMLowp output stage offset used for quantizing to QASYMM8.
Definition: Types.h:2223
float eta() const
Get eta.
Definition: Types.h:1027
int depth_output_gemm3d() const
Depth of the output when GEMM output is reinterpreted as 3D tensor.
Definition: Types.h:2366
bool use_padding
Indication of using padding.
unsigned int pooled_width() const
Get the pooled width of the layer.
Definition: Types.h:1399
unsigned int pad_top() const
Get the top padding.
Definition: Types.h:753
#define __CASE_WEIGHT_FORMAT(wf)
Output values are defined to match the source pixel whose center is nearest to the sample position...
int32_t gemmlowp_max_bound
GEMMLowp max value used to saturate down the output result before converting back to QASYMM8...
Definition: Types.h:2227
bool retain_internal_weights() const
Flag which specifies if the weights tensor has to be retained from previous run.
Definition: Types.h:2382
CLGEMMKernelType
OpenCL GEMM kernel types.
Definition: CLTypes.h:31
DetectionOutputLayerCodeType
Available Detection Output code types.
Definition: Types.h:939
ConvolutionMethod
Available ConvolutionMethod.
Definition: Types.h:134
Reshaped GEMM kernel where both lhs and rhs matrices are reshaped.
Activation Layer Information class.
Definition: Types.h:1625
GEMMLowpOutputStageType type
GEMMLowp output stage type.
Definition: Types.h:2222
decltype(strategy::transforms) typedef type
Interface for CPU tensor.
Definition: ITensor.h:36
float spatial_scale() const
Definition: Types.h:1539
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:1139
bool transpose
True if the (k0xn0) block has to be transposed before been stored.
Definition: Types.h:2261
bool interleave
True if the v0 (m0xk0) blocks have to be interleaved in the output row.
Definition: Types.h:2247
bool export_to_cl_image
True if the reshaped rhs has to be exported to cl_image.
Definition: Types.h:2263
int top_k() const
Get top K.
Definition: Types.h:1042
Copyright (c) 2017-2022 Arm Limited.
bool suppress_size() const
Get if NMS will suppress boxes based on their size/position.
Definition: Types.h:634
size_t height
Height of the image region or rectangle.
Definition: Size2D.h:91
bool is_b_reshaped() const
Flag which specifies if the matrix B has been reshaped.
Definition: Types.h:2348
int32_t x
X coordinates.
Definition: Types.h:437
ActivationFunction
Available activation functions.
Definition: Types.h:1629
1 channel, 1 F16 per channel
Samples are taken at pixel center.
float iou_threshold() const
Get intersection over union threshold.
Definition: Types.h:1129
NMSType
Available non maxima suppression types.
Definition: Types.h:565
bool is_quantized_per_channel
GEMMLowp quantized per-channel flag.
Definition: Types.h:2231
Convolution Layer Weights Information class.
Definition: Types.h:2006
1 channel, 1 S32 per channel
bool variance_encoded_in_target() const
Get if variance encoded in target.
Definition: Types.h:1012
16-bit brain floating-point number
bool transpose
True if the (m0xk0) block has to be transposed before been stored.
Definition: Types.h:2246
signed 64-bit number
int n() const
Number of matrix B columns.
Definition: Types.h:2130
Searches a minimal subset of LWS configurations while tuning.
3 channels, 1 U8 per channel
unsigned int depth_multiplier
Multiplier to apply to input&#39;s depth to retrieve the output depth.
Definition: Types.h:2205
FuseBatchNormalizationType
Available FuseBatchNormalizationType.
Definition: Types.h:158
unsigned int k0
Number of partial accumulations performed by the matrix multiplication.
Definition: Types.h:2259
unsigned int m
Number of LHS rows.
Quantization information.
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
DimensionRoundingType round_type
int32_t y
Y coordinates.
Definition: Types.h:438
size_t front
Padding across the depth dimenstion on the front, in elements.
Definition: Types.h:806
std::array< float, 2 > steps() const
Get the step coordinates.
Definition: Types.h:886
float nms() const
Get the NMS.
Definition: Types.h:604
float nms_threshold() const
Get nms threshold.
Definition: Types.h:1022
Third channel (used by formats with unknown channel types).
1 channel, 1 U32 per channel
SamplingPolicy sampling_policy
Sampling policy used by the interpolation.
GEMM RHS (Right Hand Side) matrix information.
Definition: Types.h:2251
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:2565
Channel
Available channels.
Definition: Types.h:459
Format
Image colour formats.
Definition: Types.h:56
PaddingMode
Padding mode to use for PadLayer.
Definition: Types.h:165
DimensionRoundingType round_type
Definition: Types.h:1380
uint16_t width
Width of the detection window.
Definition: Types.h:541
PadStrideInfo pad_stride_info
Convolution info (Pads, strides,...)
Definition: Types.h:2204
unsigned int n0
Number of columns processed by the matrix multiplication.
Definition: Types.h:2258
ActivationLayerInfo act_info
Fused activation to apply after convolution.
Definition: Types.h:2206
quantized, asymmetric fixed-point 8-bit number unsigned
bool are_weights_reshaped
Reshape the weights tensor if false.
Definition: Types.h:1749
size_t height
Height of the 3D shape or object.
Definition: Size3D.h:93
Coordinates of an item.
Definition: Coordinates.h:37
Pooling Layer Information struct.
Definition: Types.h:1281
float scale_value_h() const
Get h scale value.
Definition: Types.h:1156
std::pair< unsigned int, unsigned int > stride() const
Get the stride.
Definition: Types.h:717
float scale_value_w() const
Get w scale value.
Definition: Types.h:1162
Pooling Layer Information struct.
Definition: Types.h:1186
FFTDirection
FFT direction to use.
DataType input_data_type
Input tensor data type.
Size2D dilation
Dilation, in elements, across x and y.
Definition: Types.h:2207
UniformQuantizationInfo uniform() const
Return per layer quantization info.
bool is_log
Flag used to perform Log Softmax operation.
float nms_score_threshold() const
Get nms threshold.
Definition: Types.h:1124
float soft_nms_min_score_thres() const
Get soft nms min score threshold.
Definition: Types.h:629
Dimensions with dimensionality.
Definition: Dimensions.h:42
float gemmlowp_real_multiplier
GEMMLowp output stage real multiplier used for quantizing to QASYMM8.
Definition: Types.h:2230
bool reinterpret_input_as_3d
Flag used to reinterpret the input as 3D.
RoundingPolicy
Rounding method.
Definition: Rounding.h:30
GEMMLowp output stage info.
Definition: Types.h:2220
A 3 plane of 8 bit 4:4:4 sampled Y, U, V planes.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor&#39;s metadata.
Samples are taken at pixel top left corner.
PriorBox layer info.
Definition: Types.h:811
float offset() const
Get the offset.
Definition: Types.h:896
Fourth channel (used by formats with unknown channel types).
DetectionOutputLayerCodeType code_type() const
Get detection output code type.
Definition: Types.h:1007
unsigned int pad_right() const
Get the right padding.
Definition: Types.h:748
size_t top
Padding across the height dimenstion on the top, in elements.
Definition: Types.h:804
const std::vector< float > & scale() const
Scale vector accessor.
int k() const
Number of matrix A columns or matrix B rows.
Definition: Types.h:2138
Quantize using a floating point multiplication.
size_t left
Padding across the width dimenstion on the left, in elements.
Definition: Types.h:802
size_t width
Width of the 3D shape or object.
Definition: Size3D.h:92
Padding and stride information class.
Definition: Types.h:669
ComparisonOperation
Supported comparison operations.
Definition: Types.h:173
GEMMLowpOutputStageType
GEMMLowp output stage type.
Definition: Types.h:2211
Coordinates2D img_size() const
Get the image size coordinates.
Definition: Types.h:891
std::string to_string(const T &val)
Fallback method: try to use std::to_string:
Definition: TypePrinter.h:79
ActivationLayerInfo activation_info
Fused activation to apply after the matrix multiplication.
Definition: Types.h:1745
unsigned int num_kernels() const
Return the number of convolution kernels.
Definition: Types.h:2040
bool reinterpret_input_as_3d() const
Flag which specifies if the input tensor has to be reinterpreted as 3D.
Definition: Types.h:2374
Bounding Box Transform information class.
Definition: Types.h:1558
unsigned int left
left of the border
Definition: Types.h:393
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:391
::std::ostream & operator<<(::std::ostream &os, const std::vector< T > &args)
Formatted output of a vector of objects.
Definition: TypePrinter.h:95
Num samples, depth, height, width, channels.
Quantize using an integer multiplication.
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:2430
uint16_t idx_class
Index of the class.
Definition: Types.h:543
bool pretranspose_B() const
Flag which specifies whether b should be pre-transposed if supported.
Definition: Types.h:2454
int keep_top_k() const
Get the number of total bounding boxes to be kept per image.
Definition: Types.h:1017
Descriptor used by the 2d Convolution function.
Output values are determined by averaging the source pixels whose areas fall under the area of the de...
Num samples, channels, depth, height, width.
quantized, symmetric fixed-point 8-bit number
size_t back
Padding across the depth dimenstion on the back, in elements.
Definition: Types.h:807
Num samples, channels, height, width.
unsigned int max_classes_per_detection() const
Get max_classes per detection.
Definition: Types.h:1114
bool is_a_reshaped() const
Flag which specifies if the matrix A has been reshaped.
Definition: Types.h:2340
float scale_value_y() const
Get y scale value.
Definition: Types.h:1144
uint16_t height
Height of the detection window.
Definition: Types.h:542
const experimental::PostOpList< ITensorInfo * > & post_ops() const
Post operations to apply after the matrix multiplication.
Definition: Types.h:2486
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.
float min_size() const
Get size suppression threshold.
Definition: Types.h:639
int32_t a_offset
Offset to be added to each element of the matrix A.
int32_t gemmlowp_shift
GEMMLowp output stage shift used for quantizing to uint8.
Definition: Types.h:2225
Detection Output layer info.
Definition: Types.h:948
4 channels, 1 U8 per channel
experimental::PostOpList< ITensorInfo * > post_ops
PoolingType
Available pooling types.
Definition: Types.h:557
size_t right
Padding across the width dimenstion on the right, in elements.
Definition: Types.h:803
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
Rounds to nearest value; half rounds to nearest even.
size_t depth
Depth of the 3D shape or object.
Definition: Size3D.h:94
Interface for OpenCL tensor.
Definition: ICLTensor.h:42
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:1274
size_t width
Width of the image region or rectangle.
Definition: Size2D.h:90
Coordinate type.
Definition: Types.h:435
GPUTarget
Available GPU Targets.
Definition: GPUTarget.h:34
unsigned int pooled_height() const
Get the pooled height of the layer.
Definition: Types.h:1404
int m() const
Number of matrix A rows.
Definition: Types.h:2122
Borders are left undefined.
ROI Pooling Layer Information class.
Definition: Types.h:1384
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:537
DataLayout weights_trained_layout
Layout that the weights have been trained with.
Definition: Types.h:1747
const QuantizationInfo qinfo
Definition: Im2Col.cpp:155
std::vector< float > max_sizes() const
Get max sizes.
Definition: Types.h:911
ComputeAnchors information class.
Definition: Types.h:1508
CLTunerMode
< OpenCL tuner modes
Definition: CLTunerTypes.h:35
uint16_t width
Width of the rectangle.
Definition: Types.h:430
Num samples, height, width, channels.
unsigned int detection_per_class() const
Get detection per class.
Definition: Types.h:1119
bool flip() const
Get the flip value.
Definition: Types.h:901
2 channel, 1 U8 per channel
uint16_t y
Top-left y coordinate.
Definition: Types.h:540
unsigned int k
Number of LHS columns or RHS rows.
bool fp_mixed_precision
Use wider accumulators (32 bit instead of 16 for FP16) to improve accuracy.
Definition: Types.h:1753
float spatial_scale() const
Get the spatial scale.
Definition: Types.h:1409
uint16_t y
Top-left y coordinate.
Definition: Types.h:429
Detection Output layer info.
Definition: Types.h:1067
bool interleave
True if the h0 (k0xn0) blocks have to be interleaved in the output row.
Definition: Types.h:2262
unsigned int num_classes() const
Get num classes.
Definition: Types.h:1134
Use box centers and size but flip x and y co-ordinates.
experimental::PostOpList< ITensorInfo * > post_ops
(EXPERIMENTAL_POST_OPS) Specifies a list of post ops to be fused after the main op.
unsigned int axis1
Axis to run second pass on.
std::vector< float > variances() const
Get min variances.
Definition: Types.h:881
bool transpose_weights
Transpose weights if true.
Definition: Types.h:1748
Size2D kernel_size
Width and height of the kernel.
Definition: Types.h:2566
std::array< float, 4 > weights() const
Definition: Types.h:1579
Store the tensor&#39;s metadata.
Definition: TensorInfo.h:43
PixelValue constant_border_value
Constant value to use for constant border mode policy.
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:2358
unsigned int k0
Number of partial accumulations performed by the matrix multiplication.
Definition: Types.h:2244
uint16_t x
Top-left x coordinate.
Definition: Types.h:428
GEMM information class.
Definition: Types.h:2272
unsigned int m0
Number of rows processed by the matrix multiplication.
Definition: Types.h:2243
FFTDirection direction
Direction of the FFT.
ActivationFunction activation() const
Get the type of activation function.
Definition: Types.h:1663
float b() const
Get the beta value.
Definition: Types.h:1673
quantized, asymmetric fixed-point 8-bit number signed
int32_t axis
The dimension in which to apply softmax.
64-bit floating-point number
constexpr int end() const
Return the end of the dimension.
Definition: Window.h:102
Descriptor used by the softmax kernels.
int32_t gemmlowp_min_bound
GEMMLowp min value used to saturate down the output result before converting back to QASYMM8...
Definition: Types.h:2226
int mult_transpose1xW_width
Multiplication factor for the width of the 1xW transposed block.
uint16_t height
Height of the rectangle.
Definition: Types.h:431
ActivationLayerInfo act_info
unsigned int pad_bottom() const
Get the bottom padding.
Definition: Types.h:758
A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes.
DataLayout data_layout
Data layout to use.
bool clip() const
Get the clip value.
Definition: Types.h:906
static constexpr size_t num_max_dimensions
Number of dimensions the tensor has.
Definition: Dimensions.h:46
unsigned 64-bit number
DataType output_data_type
Output tensor data type to use if the output is not initialized.
Definition: Types.h:2232
DataType
Available data types.
Definition: Types.h:79
Truncates the least significant values that are lost in operations.
unsigned int pad_left() const
Get the left padding.
Definition: Types.h:743
Searches all possible LWS configurations while tuning.
ElementWiseUnary
Available element wise unary operations.
Definition: Types.h:502
DataLayout
[DataLayout enum definition]
Definition: Types.h:113
std::vector< uint32_t > Multiples
Information to produce a tiled version of a Tensor.
Definition: Types.h:456
constexpr int start() const
Return the start of the dimension.
Definition: Window.h:97
NormType
The normalization type used for the normalization layer.
Definition: Types.h:524
signed 8-bit number
A sequence of PostOps that can be appended to the end of other operators.
Definition: IPostOp.h:119
Normalization applied cross maps.
Convolution using GEMM.
Describe a multidimensional execution window.
Definition: Window.h:39
ConvertPolicy
Policy to handle integer overflow.
Definition: Types.h:404
unsigned int axis0
Axis to run first pass on.
int background_label_id() const
Get background label ID.
Definition: Types.h:1032
float im_height() const
Get image height (NMS may suppress boxes whose center sits beyond the image height) ...
Definition: Types.h:649
float confidence_threshold() const
Get confidence threshold.
Definition: Types.h:1037
Normalization applied within the same map in 2D region.
SamplingPolicy
Available Sampling Policies.
Definition: Types.h:104
std::pair< unsigned int, unsigned int > kernel_size() const
Return the width and height of the kernel.
Definition: Types.h:2048
int num_loc_classes() const
Get number of location classes.
Definition: Types.h:1047
size_t bottom
Padding across the height dimenstion on the bottom, in elements.
Definition: Types.h:805
bool soft_nms_enabled() const
Check if soft NMS is enabled.
Definition: Types.h:614
int detections_per_im() const
Get the number of detections.
Definition: Types.h:609
std::string to_string_if_not_null(T *arg)
Formatted output if arg is not null.
Definition: TypePrinter.h:60
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:876
Padding information for 3D operations like Conv3d.
Definition: Types.h:786