24 #ifndef __ARM_COMPUTE_TYPE_PRINTER_H__ 25 #define __ARM_COMPUTE_TYPE_PRINTER_H__ 79 for(
unsigned int d = 1; d < dimensions.num_dimensions(); ++d)
81 os <<
"x" << dimensions[d];
97 switch(rounding_policy)
103 os <<
"TO_NEAREST_UP";
106 os <<
"TO_NEAREST_EVEN";
151 std::stringstream
str;
165 os <<
"( m= " << gemm_info.
m;
166 os <<
" n= " << gemm_info.
n;
167 os <<
" k= " << gemm_info.
k;
174 os <<
" a_offset = " << gemm_info.
a_offset;
175 os <<
" b_offset = " << gemm_info.
b_offset;
189 os <<
"( m0= " << (
unsigned int)gemm_info.
m0 <<
" k0= " << gemm_info.
k0 <<
" v0= " << gemm_info.
v0 <<
" trans= " << gemm_info.
transpose <<
" inter= " << gemm_info.
interleave <<
"})";
202 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=" <<
215 std::stringstream
str;
228 std::stringstream
str;
241 std::stringstream
str;
255 auto weights = bbox_info.
weights();
256 os <<
"(" << bbox_info.
img_width() <<
"x" << bbox_info.
img_height() <<
")~" << bbox_info.
scale() <<
"(weights = {" << weights[0] <<
", " << weights[1] <<
", " << weights[2] <<
", " << weights[3] <<
269 std::stringstream
str;
295 std::stringstream
str;
321 std::stringstream
str;
322 str << proposals_info;
336 os <<
"Scale:" << uqinfo.
scale <<
"~";
337 os <<
"Offset:" << uqinfo.
offset;
349 std::stringstream
str;
350 str << quantization_info;
378 os <<
"BOUNDED_RELU";
390 os <<
"LU_BOUNDED_RELU";
423 std::stringstream
str;
439 std::stringstream
str;
479 std::stringstream
str;
480 str <<
info.type() <<
":NormSize=" <<
info.norm_size();
493 os <<
info.type() <<
":NormSize=" <<
info.norm_size();
533 os <<
info.pool_type;
546 std::stringstream
str;
547 str << rounding_policy;
587 std::stringstream
str;
602 switch(data_layout_dim)
646 os <<
"QASYMM8_SIGNED";
649 os <<
"QSYMM8_PER_CHANNEL";
708 std::stringstream
str;
790 std::stringstream
str;
857 std::stringstream
str;
898 os << border.
top <<
"," 899 << border.
right <<
"," 916 for(
auto const &p : padding)
918 os <<
"{" << p.first <<
"," << p.second <<
"}";
934 for(
size_t i = 0; i < multiples.size() - 1; i++)
936 os << multiples[i] <<
", ";
938 os << multiples.back() <<
")";
954 os <<
"NEAREST_NEIGHBOR";
1005 os <<
"Shape=" <<
info->tensor_shape() <<
"," 1012 os <<
"QuantizationInfo=";
1018 os <<
"(" << scales[0] <<
", " << offsets[0] <<
")";
1019 for(
size_t i = 1; i < scales.size(); ++i)
1021 os <<
",(" << scales[i] <<
", " << offsets[i] <<
")";
1055 std::stringstream
str;
1066 template <
typename T>
1069 std::stringstream
str;
1082 std::stringstream
str;
1095 std::stringstream
str;
1108 std::stringstream
str;
1122 os <<
"{m=" <<
info.m() <<
",";
1123 os <<
"n=" <<
info.n() <<
",";
1124 os <<
"k=" <<
info.k() <<
",";
1125 os <<
"mult_transpose1xW_width=" <<
info.mult_transpose1xW_width() <<
",";
1126 os <<
"mult_interleave4x4_height=" <<
info.mult_interleave4x4_height();
1141 os <<
"{is_a_reshaped=" <<
info.is_a_reshaped() <<
",";
1142 os <<
"is_b_reshaped=" <<
info.is_b_reshaped() <<
",";
1143 os <<
"reshape_b_only_on_first_run=" <<
info.reshape_b_only_on_first_run() <<
",";
1144 os <<
"depth_output_gemm3d=" <<
info.depth_output_gemm3d() <<
",";
1145 os <<
"reinterpret_input_as_3d=" <<
info.reinterpret_input_as_3d() <<
",";
1146 os <<
"retain_internal_weights=" <<
info.retain_internal_weights() <<
",";
1147 os <<
"fp_mixed_precision=" <<
info.fp_mixed_precision() <<
",";
1148 os <<
"broadcast_bias=" <<
info.broadcast_bias() <<
",";
1149 os <<
"pretranpose_B=" <<
info.pretranpose_B() <<
",";
1163 os <<
"{start=" << dim.
start() <<
", end=" << dim.
end() <<
", step=" << dim.
step() <<
"}";
1198 std::stringstream
str;
1211 std::stringstream
str;
1224 std::stringstream
str;
1237 std::stringstream
str;
1249 std::stringstream
str;
1264 os <<
"+" << rect.
x <<
"+" << rect.
y;
1304 std::stringstream
str;
1318 os << pad_stride_info.
stride().first <<
"," << pad_stride_info.
stride().second;
1334 std::stringstream
str;
1335 str << pad_stride_info;
1347 std::stringstream
str;
1360 std::stringstream
str;
1373 std::stringstream
str;
1386 std::stringstream
str;
1399 std::stringstream
str;
1412 std::stringstream
str;
1443 std::stringstream
str;
1475 os <<
"SQUARED_DIFF";
1495 std::stringstream
str;
1521 os <<
"ARG_IDX_MAX";
1524 os <<
"ARG_IDX_MIN";
1550 std::stringstream
str;
1576 os <<
"GreaterEqual";
1632 std::stringstream
str;
1645 std::stringstream
str;
1658 std::stringstream
str;
1671 std::stringstream
str;
1684 std::stringstream
str;
1685 str <<
"{Type=" <<
info.pool_type <<
"," 1687 <<
"IsGlobalPooling=" <<
info.is_global_pooling;
1688 if(!
info.is_global_pooling)
1691 <<
"PoolSize=" <<
info.pool_size.width <<
"," <<
info.pool_size.height <<
"," 1692 <<
"PadStride=" <<
info.pad_stride_info;
1706 std::stringstream
str;
1709 <<
"Flip:" <<
info.flip()
1710 <<
"StepX:" <<
info.steps()[0]
1711 <<
"StepY:" <<
info.steps()[1]
1712 <<
"MinSizes:" <<
info.min_sizes().size()
1713 <<
"MaxSizes:" <<
info.max_sizes().size()
1714 <<
"ImgSizeX:" <<
info.img_size().x
1715 <<
"ImgSizeY:" <<
info.img_size().y
1716 <<
"Offset:" <<
info.offset()
1717 <<
"Variances:" <<
info.variances().size();
1744 std::stringstream
str;
1784 std::stringstream
str;
1801 os <<
"GPU_ARCH_MASK";
1863 std::stringstream
str;
1877 os <<
"{x=" << detection_window.
x <<
"," 1878 <<
"y=" << detection_window.
y <<
"," 1879 <<
"width=" << detection_window.
width <<
"," 1880 <<
"height=" << detection_window.
height <<
"," 1881 <<
"idx_class=" << detection_window.
idx_class <<
"," 1882 <<
"score=" << detection_window.
score <<
"}";
1896 switch(detection_code)
1899 os <<
"CENTER_SIZE";
1905 os <<
"CORNER_SIZE";
1924 std::stringstream
str;
1925 str << detection_code;
1938 os <<
"{Classes=" << detection_info.
num_classes() <<
"," 1940 <<
"CodeType=" << detection_info.
code_type() <<
"," 1942 <<
"KeepTopK=" << detection_info.
keep_top_k() <<
"," 1944 <<
"Eta=" << detection_info.
eta() <<
"," 1947 <<
"TopK=" << detection_info.
top_k() <<
"," 1962 std::stringstream
str;
1963 str << detection_info;
1975 os <<
"{MaxDetections=" << detection_info.
max_detections() <<
"," 1978 <<
"NmsIouThreshold=" << detection_info.
iou_threshold() <<
"," 1979 <<
"NumClasses=" << detection_info.
num_classes() <<
"," 1999 std::stringstream
str;
2000 str << detection_info;
2012 std::stringstream
str;
2013 str << detection_window;
2032 os <<
"GENERIC_FP16";
2035 os <<
"GENERIC_FP16_DOT";
2067 std::stringstream
str;
2078 template <
typename T>
2083 for(
auto &arg :
args)
2108 os <<
"Clip:" <<
info.clip()
2109 <<
"Flip:" <<
info.flip()
2110 <<
"StepX:" <<
info.steps()[0]
2111 <<
"StepY:" <<
info.steps()[1]
2112 <<
"MinSizes:" <<
info.min_sizes()
2113 <<
"MaxSizes:" <<
info.max_sizes()
2114 <<
"ImgSizeX:" <<
info.img_size().x
2115 <<
"ImgSizeY:" <<
info.img_size().y
2116 <<
"Offset:" <<
info.offset()
2117 <<
"Variances:" <<
info.variances();
2128 template <
typename T>
2131 std::stringstream
str;
2139 os <<
"{OutputTileSize=" <<
info.output_tile_size <<
"," 2140 <<
"KernelSize=" <<
info.kernel_size <<
"," 2141 <<
"PadStride=" <<
info.convolution_info <<
"," 2142 <<
"OutputDataLayout=" <<
info.output_data_layout <<
"}";
2149 std::stringstream
str;
2160 template <
typename T>
2178 return std::string(
"Exhaustive");
2182 return std::string(
"Normal");
2186 return std::string(
"Rapid");
2191 return std::string(
"UNDEFINED");
2211 return "Reshaped_V1";
2219 return "Reshaped_Only_RHS";
BorderMode
Methods available to handle borders.
bool is_data_type_quantized(DataType dt)
Check if a given data type is of quantized type.
const std::vector< int32_t > & offset() const
Offset vector accessor.
unsigned int top
top of the border
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.
InterpolationPolicy
Interpolation method.
int num_classes() const
Get num classes.
int mult_interleave4x4_height
Multiplication factor for the height of the 4x4 interleaved block.
Generate Proposals Information class.
Second channel (used by formats with unknown channel types).
bool share_location() const
Get share location.
float scale_value_x() const
Get x scale value.
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.
Use box centers and size.
Descriptor used by the GEMM kernels.
uint16_t x
Top-left x coordinate.
float score
Confidence value for the detection window.
std::vector< PaddingInfo > PaddingList
List of padding information.
ReductionOperation
Available reduction operations.
Container for 2D border size.
unsigned int max_detections() const
Get max detections.
unsigned int v0
Number of vertical blocks of size (m0xk0) stored on the same output row.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
constexpr int step() const
Return the step of the dimension.
unsigned int depth_output_gemm3d
Depth of the output tensor in case is reinterpreted as 3D.
DataLayoutDimension
[DataLayout enum definition]
1 channel, 1 U8 per channel
GEMM reshape information class.
std::string to_string(T &&value)
Convert integer and float values to string.
1 channel, 1 F32 per channel
Normalization Layer Information class.
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.
const DataLayout data_layout
GEMM LHS (Left Hand Side) matrix information.
Store the tensor's metadata.
A 2 plane YUV format of Luma (Y) and interleaved UV data at 4:2:0 sampling.
Describe one of the image's dimensions with a start, end and step.
quantized, asymmetric fixed-point 16-bit number
1 channel, 1 U16 per channel
unsigned int bottom
bottom of the border
CPUModel
CPU models - we only need to detect CPUs we have microarchitecture-specific code for.
Reshaped GEMM kernel where only the rhs matrix is reshaped.
float eta() const
Get eta.
unsigned int pooled_width() const
Get the pooled width of the layer.
unsigned int pad_top() const
Get the top padding.
Output values are defined to match the source pixel whose center is nearest to the sample position.
CLGEMMKernelType
OpenCL GEMM kernel types.
DetectionOutputLayerCodeType
Available Detection Output code types.
ConvolutionMethod
Available ConvolutionMethod.
Reshaped GEMM kernel where both lhs and rhs matrices are reshaped.
Activation Layer Information class.
decltype(strategy::transforms) typedef type
float spatial_scale() const
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.
bool transpose
True if the (k0xn0) block has to be transposed before been stored.
bool interleave
True if the v0 (m0xk0) blocks have to be interleaved in the output row.
bool export_to_cl_image
True if the reshaped rhs has to be exported to cl_image.
int top_k() const
Get top K.
float feat_height() const
Copyright (c) 2017-2021 Arm Limited.
size_t height
Height of the image region or rectangle.
ActivationFunction
Available activation functions.
1 channel, 1 F16 per channel
Samples are taken at pixel center.
Greater equal comparison ( )
float iou_threshold() const
Get intersection over union threshold.
Convolution Layer Weights Information class.
1 channel, 1 S32 per channel
bool variance_encoded_in_target() const
Get if variance encoded in target.
16-bit brain floating-point number
bool transpose
True if the (m0xk0) block has to be transposed before been stored.
Searches a minimal subset of LWS configurations while tuning.
Native GEMM kernel with fixed block size.
3 channels, 1 U8 per channel
unsigned int k0
Number of partial accumulations performed by the matrix multiplication.
unsigned int m
Number of LHS rows.
Quantization information.
std::string to_string(const ROIPoolingLayerInfo &pool_info)
Formatted output of the ROIPoolingInfo type.
unsigned int n
Number of RHS columns.
const std::string & string_from_data_type(DataType dt)
Convert a data type identity into a string.
Exponential Linear Unit ( )
float nms_threshold() const
Get nms threshold.
Third channel (used by formats with unknown channel types).
1 channel, 1 U32 per channel
bool is_data_type_quantized_per_channel(DataType dt)
Check if a given data type is of per channel type.
GEMM RHS (Right Hand Side) matrix information.
int32_t b_offset
Offset to be added to each element of the matrix B.
Normalization applied within the same map in 1D region.
Channel
Available channels.
Format
Image colour formats.
PaddingMode
Padding mode to use for PadLayer.
uint16_t width
Width of the detection window.
unsigned int n0
Number of columns processed by the matrix multiplication.
quantized, asymmetric fixed-point 8-bit number unsigned
float scale_value_h() const
Get h scale value.
std::pair< unsigned int, unsigned int > stride() const
Get the stride.
float scale_value_w() const
Get w scale value.
Pooling Layer Information struct.
UniformQuantizationInfo uniform() const
Return per layer quantization info.
float nms_score_threshold() const
Get nms threshold.
Dimensions with dimensionality.
bool reinterpret_input_as_3d
Flag used to reinterpret the input as 3D.
RoundingPolicy
Rounding method.
A 3 plane of 8 bit 4:4:4 sampled Y, U, V planes.
Samples are taken at pixel top left corner.
Fourth channel (used by formats with unknown channel types).
DetectionOutputLayerCodeType code_type() const
Get detection output code type.
unsigned int pad_right() const
Get the right padding.
const std::vector< float > & scale() const
Scale vector accessor.
Padding and stride information class.
ComparisonOperation
Supported comparison operations.
unsigned int left
left of the border
unsigned int right
right of the border
1 channel, 1 S16 per channel
uint16_t idx_class
Index of the class.
int keep_top_k() const
Get the number of total bounding boxes to be kept per image.
Output values are determined by averaging the source pixels whose areas fall under the area of the de...
quantized, symmetric fixed-point 8-bit number
Num samples, channels, height, width.
unsigned int max_classes_per_detection() const
Get max_classes per detection.
float scale_value_y() const
Get y scale value.
uint16_t height
Height of the detection window.
Strides of an item in bytes.
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.
Lower and Upper Bounded Rectifier ( )
int32_t a_offset
Offset to be added to each element of the matrix A.
Detection Output layer info.
4 channels, 1 U8 per channel
PoolingType
Available pooling types.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
Rounds to nearest value; half rounds to nearest even.
const std::string & string_from_data_layout(DataLayout dl)
Convert a data layout identity into a string.
Upper Bounded Rectifier ( )
size_t width
Width of the image region or rectangle.
GPUTarget
Available GPU Targets.
unsigned int pooled_height() const
Get the pooled height of the layer.
Borders are left undefined.
ROI Pooling Layer Information class.
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.
Detection window used for the object detection.
const QuantizationInfo qinfo
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
ComputeAnchors information class.
CLTunerMode
< OpenCL tuner modes
uint16_t width
Width of the rectangle.
Num samples, height, width, channels.
unsigned int detection_per_class() const
Get detection per class.
2 channel, 1 U8 per channel
uint16_t y
Top-left y coordinate.
unsigned int k
Number of LHS columns or RHS rows.
float spatial_scale() const
Get the spatial scale.
Less equal comparison ( )
uint16_t y
Top-left y coordinate.
Detection Output layer info.
bool interleave
True if the h0 (k0xn0) blocks have to be interleaved in the output row.
unsigned int num_classes() const
Get num classes.
Use box centers and size but flip x and y co-ordinates.
Use box centers and size.
Store the tensor's metadata.
unsigned int k0
Number of partial accumulations performed by the matrix multiplication.
uint16_t x
Top-left x coordinate.
unsigned int m0
Number of rows processed by the matrix multiplication.
quantized, asymmetric fixed-point 8-bit number signed
64-bit floating-point number
constexpr int end() const
Return the end of the dimension.
int mult_transpose1xW_width
Multiplication factor for the width of the 1xW transposed block.
uint16_t height
Height of the rectangle.
unsigned int pad_bottom() const
Get the bottom padding.
A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes.
DataLayout data_layout
Data layout to use.
static constexpr size_t num_max_dimensions
Number of dimensions the tensor has.
DataType
Available data types.
Truncates the least significant values that are lost in operations.
unsigned int pad_left() const
Get the left padding.
Reshaped GEMM kernel where both lhs and rhs matrices are reshaped.
Searches all possible LWS configurations while tuning.
ElementWiseUnary
Available element wise unary operations.
DataLayout
[DataLayout enum definition]
std::vector< uint32_t > Multiples
Information to produce a tiled version of a Tensor.
constexpr int start() const
Return the start of the dimension.
NormType
The normalization type used for the normalization layer.
Normalization applied cross maps.
Describe a multidimensional execution window.
ConvertPolicy
Policy to handle overflow.
int background_label_id() const
Get background label ID.
float confidence_threshold() const
Get confidence threshold.
Normalization applied within the same map in 2D region.
SamplingPolicy
Available Sampling Policies.
int num_loc_classes() const
Get number of location classes.
inline ::std::ostream & operator<<(::std::ostream &os, const Dimensions< T > &dimensions)
Formatted output of the Dimensions type.
std::string to_string_if_not_null(T *arg)
Formatted output if arg is not null.