From 12be7ab4876f77fecfab903df70791623219b3da Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Tue, 3 Jul 2018 12:06:23 +0100 Subject: COMPMID-1310: Create graph validation executables. Change-Id: I9e0b57b1b83fe5a95777cdaeddba6ecef650bafc Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/138697 Reviewed-by: Anthony Barbier Tested-by: Jenkins --- arm_compute/graph/TypePrinter.h | 239 +--------------------------------------- 1 file changed, 2 insertions(+), 237 deletions(-) (limited to 'arm_compute/graph/TypePrinter.h') diff --git a/arm_compute/graph/TypePrinter.h b/arm_compute/graph/TypePrinter.h index 177a5e2f38..c3601f2373 100644 --- a/arm_compute/graph/TypePrinter.h +++ b/arm_compute/graph/TypePrinter.h @@ -28,89 +28,12 @@ #include "arm_compute/core/Types.h" #include "arm_compute/graph/Types.h" +#include "utils/TypePrinter.h" + namespace arm_compute { namespace graph { -/** Formatted output of the Dimensions type. */ -template -inline ::std::ostream &operator<<(::std::ostream &os, const arm_compute::Dimensions &dimensions) -{ - if(dimensions.num_dimensions() > 0) - { - os << dimensions[0]; - - for(unsigned int d = 1; d < dimensions.num_dimensions(); ++d) - { - os << "x" << dimensions[d]; - } - } - - return os; -} - -/** Formatted output of the Size2D type. */ -inline ::std::ostream &operator<<(::std::ostream &os, const Size2D &size) -{ - os << size.width << "x" << size.height; - - return os; -} - -/** Formatted output of the DataType type. */ -inline ::std::ostream &operator<<(::std::ostream &os, const DataType &data_type) -{ - switch(data_type) - { - case DataType::UNKNOWN: - os << "UNKNOWN"; - break; - case DataType::U8: - os << "U8"; - break; - case DataType::QASYMM8: - os << "QASYMM8"; - break; - case DataType::S8: - os << "S8"; - break; - case DataType::U16: - os << "U16"; - break; - case DataType::S16: - os << "S16"; - break; - case DataType::U32: - os << "U32"; - break; - case DataType::S32: - os << "S32"; - break; - case DataType::U64: - os << "U64"; - break; - case DataType::S64: - os << "S64"; - break; - case DataType::F16: - os << "F16"; - break; - case DataType::F32: - os << "F32"; - break; - case DataType::F64: - os << "F64"; - break; - case DataType::SIZET: - os << "SIZET"; - break; - default: - ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); - } - - return os; -} - /** Formatted output of the Target. */ inline ::std::ostream &operator<<(::std::ostream &os, const Target &target) { @@ -135,24 +58,6 @@ inline ::std::ostream &operator<<(::std::ostream &os, const Target &target) return os; } -/** Formatted output of the DataLayout */ -inline ::std::ostream &operator<<(::std::ostream &os, const DataLayout &data_layout) -{ - switch(data_layout) - { - case DataLayout::NCHW: - os << "NCHW"; - break; - case DataLayout::NHWC: - os << "NHWC"; - break; - default: - ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); - } - - return os; -} - inline ::std::ostream &operator<<(::std::ostream &os, const NodeType &node_type) { switch(node_type) @@ -224,100 +129,6 @@ inline ::std::ostream &operator<<(::std::ostream &os, const NodeType &node_type) return os; } -/** Formatted output of the activation function type. */ -inline ::std::ostream &operator<<(::std::ostream &os, const ActivationLayerInfo::ActivationFunction &act_function) -{ - switch(act_function) - { - case ActivationLayerInfo::ActivationFunction::ABS: - os << "ABS"; - break; - case ActivationLayerInfo::ActivationFunction::LINEAR: - os << "LINEAR"; - break; - case ActivationLayerInfo::ActivationFunction::LOGISTIC: - os << "LOGISTIC"; - break; - case ActivationLayerInfo::ActivationFunction::RELU: - os << "RELU"; - break; - case ActivationLayerInfo::ActivationFunction::BOUNDED_RELU: - os << "BOUNDED_RELU"; - break; - case ActivationLayerInfo::ActivationFunction::LEAKY_RELU: - os << "LEAKY_RELU"; - break; - case ActivationLayerInfo::ActivationFunction::SOFT_RELU: - os << "SOFT_RELU"; - break; - case ActivationLayerInfo::ActivationFunction::SQRT: - os << "SQRT"; - break; - case ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU: - os << "LU_BOUNDED_RELU"; - break; - case ActivationLayerInfo::ActivationFunction::SQUARE: - os << "SQUARE"; - break; - case ActivationLayerInfo::ActivationFunction::TANH: - os << "TANH"; - break; - default: - ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); - } - - return os; -} - -inline std::string to_string(const ActivationLayerInfo::ActivationFunction &act_function) -{ - std::stringstream str; - str << act_function; - return str.str(); -} - -/** Formatted output of the PoolingType type. */ -inline ::std::ostream &operator<<(::std::ostream &os, const PoolingType &pool_type) -{ - switch(pool_type) - { - case PoolingType::AVG: - os << "AVG"; - break; - case PoolingType::MAX: - os << "MAX"; - break; - case PoolingType::L2: - os << "L2"; - break; - default: - ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); - } - - return os; -} - -/** Formatted output of the NormType type. */ -inline ::std::ostream &operator<<(::std::ostream &os, const NormType &norm_type) -{ - switch(norm_type) - { - case NormType::CROSS_MAP: - os << "CROSS_MAP"; - break; - case NormType::IN_MAP_1D: - os << "IN_MAP_1D"; - break; - case NormType::IN_MAP_2D: - os << "IN_MAP_2D"; - break; - default: - ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); - } - - return os; -} - /** Formatted output of the EltwiseOperation type. */ inline ::std::ostream &operator<<(::std::ostream &os, const EltwiseOperation &eltwise_op) { @@ -401,52 +212,6 @@ inline ::std::ostream &operator<<(::std::ostream &os, const DepthwiseConvolution return os; } - -/** Formatted output of the PadStrideInfo type. */ -inline ::std::ostream &operator<<(::std::ostream &os, const PadStrideInfo &pad_stride_info) -{ - os << pad_stride_info.stride().first << "," << pad_stride_info.stride().second; - os << ";"; - os << pad_stride_info.pad_left() << "," << pad_stride_info.pad_right() << "," - << pad_stride_info.pad_top() << "," << pad_stride_info.pad_bottom(); - - return os; -} - -/** Formatted output of the QuantizationInfo type. */ -inline ::std::ostream &operator<<(::std::ostream &os, const QuantizationInfo &quantization_info) -{ - os << "Scale:" << quantization_info.scale << "~" - << "Offset:" << quantization_info.offset; - return os; -} - -/** Formatted output of the Interpolation policy type. - * - * @param[out] os Output stream. - * @param[in] policy Interpolation policy to output. - * - * @return Modified output stream. - */ -inline ::std::ostream &operator<<(::std::ostream &os, const InterpolationPolicy &policy) -{ - switch(policy) - { - case InterpolationPolicy::NEAREST_NEIGHBOR: - os << "NEAREST NEIGHBOR"; - break; - case InterpolationPolicy::BILINEAR: - os << "BILINEAR"; - break; - case InterpolationPolicy::AREA: - os << "AREA"; - break; - default: - ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); - } - - return os; -} } // namespace graph } // namespace arm_compute #endif /* __ARM_COMPUTE_GRAPH_TYPE_PRINTER_H__ */ -- cgit v1.2.1