24 #ifndef __ARM_COMPUTE_TYPE_PRINTER_H__ 25 #define __ARM_COMPUTE_TYPE_PRINTER_H__ 72 inline ::std::ostream &operator<<(::std::ostream &os, const Dimensions<T> &dimensions)
74 if(dimensions.num_dimensions() > 0)
78 for(
unsigned int d = 1; d < dimensions.num_dimensions(); ++d)
80 os <<
"," << dimensions[d];
96 switch(rounding_policy)
102 os <<
"TO_NEAREST_UP";
105 os <<
"TO_NEAREST_EVEN";
150 std::stringstream
str;
164 os <<
"( m= " << gemm_info.
m;
165 os <<
" n= " << gemm_info.
n;
166 os <<
" k= " << gemm_info.
k;
173 os <<
" a_offset = " << gemm_info.
a_offset;
174 os <<
" b_offset = " << gemm_info.
b_offset;
188 os <<
"( m0= " << (
unsigned int)gemm_info.
m0 <<
" k0= " << gemm_info.
k0 <<
" v0= " << gemm_info.
v0 <<
" trans= " << gemm_info.
transpose <<
" inter= " << gemm_info.
interleave <<
"})";
201 os <<
"( n0= " << (
unsigned int)gemm_info.
n0 <<
" k0= " << gemm_info.
k0 <<
" h0= " << gemm_info.
h0 <<
" trans= " << gemm_info.
transpose <<
" inter= " << gemm_info.
interleave <<
" exp_img=" <<
214 std::stringstream
str;
227 std::stringstream
str;
240 std::stringstream
str;
254 auto weights = bbox_info.
weights();
255 os <<
"(" << bbox_info.
img_width() <<
"x" << bbox_info.
img_height() <<
")~" << bbox_info.
scale() <<
"(weights = {" << weights[0] <<
", " << weights[1] <<
", " << weights[2] <<
", " << weights[3] <<
268 std::stringstream
str;
294 std::stringstream
str;
320 std::stringstream
str;
321 str << proposals_info;
335 os <<
"Scale:" << uqinfo.
scale <<
"~";
336 os <<
"Offset:" << uqinfo.
offset;
348 std::stringstream
str;
349 str << quantization_info;
377 os <<
"BOUNDED_RELU";
389 os <<
"LU_BOUNDED_RELU";
422 std::stringstream
str;
438 std::stringstream
str;
478 std::stringstream
str;
545 std::stringstream
str;
546 str << rounding_policy;
586 std::stringstream
str;
601 switch(data_layout_dim)
645 os <<
"QASYMM8_SIGNED";
648 os <<
"QSYMM8_PER_CHANNEL";
707 std::stringstream
str;
789 std::stringstream
str;
856 std::stringstream
str;
897 os << border.
top <<
"," 898 << border.
right <<
"," 915 for(
auto const &p : padding)
917 os <<
"{" << p.first <<
"," << p.second <<
"}";
933 for(
size_t i = 0; i < multiples.size() - 1; i++)
935 os << multiples[i] <<
", ";
937 os << multiples.back() <<
")";
953 os <<
"NEAREST_NEIGHBOR";
1011 os <<
"QuantizationInfo=";
1015 const auto scales = qinfo.
scale();
1016 const auto offsets = qinfo.
offset();
1017 os <<
"(" << scales[0] <<
", " << offsets[0] <<
")";
1018 for(
size_t i = 1; i < scales.size(); ++i)
1020 os <<
",(" << scales[i] <<
", " << offsets[i] <<
")";
1054 std::stringstream
str;
1065 template <
typename T>
1068 std::stringstream
str;
1081 std::stringstream
str;
1094 std::stringstream
str;
1107 std::stringstream
str;
1121 os <<
"{m=" << info.
m() <<
",";
1122 os <<
"n=" << info.
n() <<
",";
1123 os <<
"k=" << info.
k() <<
",";
1162 os <<
"{start=" << dim.
start() <<
", end=" << dim.
end() <<
", step=" << dim.
step() <<
"}";
1197 std::stringstream
str;
1210 std::stringstream
str;
1223 std::stringstream
str;
1236 std::stringstream
str;
1248 std::stringstream
str;
1263 os <<
"+" << rect.
x <<
"+" << rect.
y;
1303 std::stringstream
str;
1317 os << pad_stride_info.
stride().first <<
"," << pad_stride_info.
stride().second;
1333 std::stringstream
str;
1334 str << pad_stride_info;
1346 std::stringstream
str;
1359 std::stringstream
str;
1372 std::stringstream
str;
1385 std::stringstream
str;
1398 std::stringstream
str;
1411 std::stringstream
str;
1442 std::stringstream
str;
1474 os <<
"SQUARED_DIFF";
1494 std::stringstream
str;
1520 os <<
"ARG_IDX_MAX";
1523 os <<
"ARG_IDX_MIN";
1549 std::stringstream
str;
1575 os <<
"GreaterEqual";
1631 std::stringstream
str;
1644 std::stringstream
str;
1657 std::stringstream
str;
1670 std::stringstream
str;
1683 std::stringstream
str;
1684 str <<
"{Type=" << info.
pool_type <<
"," 1705 std::stringstream
str;
1707 str <<
"Clip:" << info.
clip()
1708 <<
"Flip:" << info.
flip()
1709 <<
"StepX:" << info.
steps()[0]
1710 <<
"StepY:" << info.
steps()[1]
1711 <<
"MinSizes:" << info.
min_sizes().size()
1712 <<
"MaxSizes:" << info.
max_sizes().size()
1715 <<
"Offset:" << info.
offset()
1716 <<
"Variances:" << info.
variances().size();
1743 std::stringstream
str;
1783 std::stringstream
str;
1800 os <<
"GPU_ARCH_MASK";
1865 std::stringstream
str;
1879 os <<
"{x=" << detection_window.
x <<
"," 1880 <<
"y=" << detection_window.
y <<
"," 1881 <<
"width=" << detection_window.
width <<
"," 1882 <<
"height=" << detection_window.
height <<
"," 1883 <<
"idx_class=" << detection_window.
idx_class <<
"," 1884 <<
"score=" << detection_window.
score <<
"}";
1898 switch(detection_code)
1901 os <<
"CENTER_SIZE";
1907 os <<
"CORNER_SIZE";
1926 std::stringstream
str;
1927 str << detection_code;
1940 os <<
"{Classes=" << detection_info.
num_classes() <<
"," 1942 <<
"CodeType=" << detection_info.
code_type() <<
"," 1944 <<
"KeepTopK=" << detection_info.
keep_top_k() <<
"," 1946 <<
"Eta=" << detection_info.
eta() <<
"," 1949 <<
"TopK=" << detection_info.
top_k() <<
"," 1964 std::stringstream
str;
1965 str << detection_info;
1977 os <<
"{MaxDetections=" << detection_info.
max_detections() <<
"," 1980 <<
"NmsIouThreshold=" << detection_info.
iou_threshold() <<
"," 1981 <<
"NumClasses=" << detection_info.
num_classes() <<
"," 2001 std::stringstream
str;
2002 str << detection_info;
2014 std::stringstream
str;
2015 str << detection_window;
2026 template <
typename T>
2027 inline ::std::ostream &operator<<(::std::ostream &os, const std::vector<T> &
args)
2031 for(
auto &arg :
args)
2056 os <<
"Clip:" << info.
clip()
2057 <<
"Flip:" << info.
flip()
2058 <<
"StepX:" << info.
steps()[0]
2059 <<
"StepY:" << info.
steps()[1]
2064 <<
"Offset:" << info.
offset()
2076 template <
typename T>
2079 std::stringstream
str;
2097 std::stringstream
str;
2108 template <
typename T>
2126 return std::string(
"Exhaustive");
2130 return std::string(
"Normal");
2134 return std::string(
"Rapid");
2139 return std::string(
"UNDEFINED");
2159 return "Reshaped_V1";
2167 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() const
Multiplication factor for the height of the 4x4 interleaved block.
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.
DataLayout output_data_layout
Data layout to use for the output tensor once the convolution has been applied (NCHW or NHWC) ...
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.
bool enabled() const
Check if initialised.
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]
uint32_t norm_size() const
Get the normalization size.
1 channel, 1 U8 per channel
NormType type() const
Get the normalization type.
int mult_transpose1xW_width() const
Multiplication factor for the width of the 1xW transposed block.
GEMM reshape information class.
PadStrideInfo convolution_info
Convolution info (Pads, strides,...)
std::string to_string(T &&value)
Convert integer and float values to string.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
bool are_reshaped() const
Flag which specifies if the weights tensor has been reshaped.
1 channel, 1 F32 per channel
Searches a subset of LWS configurations while tuning.
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
bool fp_mixed_precision() const
Flag which specifies if a wider accumulator should be used.
GEMM LHS (Left Hand Side) matrix information.
Store the tensor's metadata.
bool pretranpose_B() const
Flag which specifies whether b should be pre-transposed if supported.
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
Reshaped GEMM kernel where only the rhs matrix is reshaped.
float eta() const
Get eta.
int depth_output_gemm3d() const
Depth of the output when GEMM output is reinterpreted as 3D tensor.
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...
bool retain_internal_weights() const
Flag which specifies if the weights tensor has to be retained from previous run.
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.
bool is_b_reshaped() const
Flag which specifies if the matrix B has been reshaped.
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.
int n() const
Number of matrix B columns.
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 ( )
std::array< float, 2 > steps() const
Get the step coordinates.
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.
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.
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.
float offset() const
Get the offset.
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.
int k() const
Number of matrix A columns or matrix B rows.
Padding and stride information class.
ComparisonOperation
Supported comparison operations.
Coordinates2D img_size() const
Get the image size coordinates.
unsigned int num_kernels() const
Return the number of convolution kernels.
bool reinterpret_input_as_3d() const
Flag which specifies if the input tensor has to be reinterpreted as 3D.
unsigned int left
left of the border
virtual QuantizationInfo quantization_info() const =0
Get the quantization settings (scale and offset) of the tensor.
unsigned int right
right of the border
1 channel, 1 S16 per channel
bool broadcast_bias() const
Flag which specifies whether to broadcast the shape of the bias tensor.
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.
bool is_a_reshaped() const
Flag which specifies if the matrix A has been reshaped.
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 ( )
PadStrideInfo pad_stride_info
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.
int m() const
Number of matrix A rows.
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
std::vector< float > max_sizes() const
Get max sizes.
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.
bool flip() const
Get the flip value.
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.
std::vector< float > variances() const
Get min variances.
Size2D kernel_size
Width and height of the kernel.
Store the tensor's metadata.
bool reshape_b_only_on_first_run() const
Flag which specifies if the reshape of matrix B should executed only for the first.
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.
ActivationFunction activation() const
Get the type of activation function.
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.
bool clip() const
Get the clip value.
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.
std::pair< unsigned int, unsigned int > kernel_size() const
Return the width and height of the kernel.
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.
virtual DataLayout data_layout() const =0
Get the data layout of the tensor.
std::vector< float > min_sizes() const
Get min sizes.