24 #ifndef ARM_COMPUTE_VALIDATE_H 25 #define ARM_COMPUTE_VALIDATE_H 53 for(
unsigned int i = upper_dim; i < arm_compute::Dimensions<T>::num_max_dimensions; ++i)
55 if(dim1[i] != dim2[i])
83 : _dim{ dim }, _function{
function }, _file{ file }, _line{ line }
96 "Objects have different dimensions");
102 const char *
const _function;
103 const char *
const _file;
107 template <
typename F>
113 template <
typename F,
typename T,
typename... Ts>
122 template <
typename T>
136 return tensor->
info();
150 template <
typename... Ts>
153 const std::array<
const void *,
sizeof...(Ts)> pointers_array{ { std::forward<Ts>(pointers)... } };
154 bool has_nullptr = std::any_of(pointers_array.begin(), pointers_array.end(), [&](
const void *ptr)
156 return (ptr ==
nullptr);
161 #define ARM_COMPUTE_ERROR_ON_NULLPTR(...) \ 162 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_nullptr(__func__, __FILE__, __LINE__, __VA_ARGS__)) 163 #define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...) \ 164 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_nullptr(__func__, __FILE__, __LINE__, __VA_ARGS__)) 182 const Window &full,
const Window &win);
183 #define ARM_COMPUTE_ERROR_ON_MISMATCHING_WINDOWS(f, w) \ 184 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_windows(__func__, __FILE__, __LINE__, f, w)) 185 #define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_WINDOWS(f, w) \ 186 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_mismatching_windows(__func__, __FILE__, __LINE__, f, w)) 204 const Window &full,
const Window &sub);
205 #define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s) \ 206 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_invalid_subwindow(__func__, __FILE__, __LINE__, f, s)) 207 #define ARM_COMPUTE_RETURN_ERROR_ON_INVALID_SUBWINDOW(f, s) \ 208 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_invalid_subwindow(__func__, __FILE__, __LINE__, f, s)) 224 const Window &full,
const Window &window,
const int dim);
225 #define ARM_COMPUTE_ERROR_ON_WINDOW_NOT_COLLAPSABLE_AT_DIMENSION(f, w, d) \ 226 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_window_not_collapsable_at_dimension(__func__, __FILE__, __LINE__, f, w, d)) 227 #define ARM_COMPUTE_RETURN_ERROR_ON_WINDOW_NOT_COLLAPSABLE_AT_DIMENSION(f, w, d) \ 228 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_window_not_collapsable_at_dimension(__func__, __FILE__, __LINE__, f, w, d)) 243 const Coordinates &pos,
unsigned int max_dim);
244 #define ARM_COMPUTE_ERROR_ON_COORDINATES_DIMENSIONS_GTE(p, md) \ 245 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_coordinates_dimensions_gte(__func__, __FILE__, __LINE__, p, md)) 246 #define ARM_COMPUTE_RETURN_ERROR_ON_COORDINATES_DIMENSIONS_GTE(p, md) \ 247 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_coordinates_dimensions_gte(__func__, __FILE__, __LINE__, p, md)) 262 const Window &win,
unsigned int max_dim);
263 #define ARM_COMPUTE_ERROR_ON_WINDOW_DIMENSIONS_GTE(w, md) \ 264 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_window_dimensions_gte(__func__, __FILE__, __LINE__, w, md)) 265 #define ARM_COMPUTE_RETURN_ERROR_ON_WINDOW_DIMENSIONS_GTE(w, md) \ 266 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_window_dimensions_gte(__func__, __FILE__, __LINE__, w, md)) 279 template <
typename T,
typename... Ts>
286 #define ARM_COMPUTE_ERROR_ON_MISMATCHING_DIMENSIONS(...) \ 287 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_dimensions(__func__, __FILE__, __LINE__, __VA_ARGS__)) 288 #define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(...) \ 289 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_mismatching_dimensions(__func__, __FILE__, __LINE__, __VA_ARGS__)) 302 template <
typename... Ts>
308 const std::array <
const ITensor *, 1 +
sizeof...(Ts) > tensors_info_array{ { tensor1, std::forward<Ts>(tensors)... } };
314 function, file, line,
"Tensor shape has odd dimensions");
318 #define ARM_COMPUTE_ERROR_ON_TENSORS_NOT_EVEN(...) \ 319 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_tensors_not_even(__func__, __FILE__, __LINE__, __VA_ARGS__)) 320 #define ARM_COMPUTE_RETURN_ERROR_ON_TENSORS_NOT_EVEN(...) \ 321 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_tensors_not_even(__func__, __FILE__, __LINE__, __VA_ARGS__)) 335 template <
typename... Ts>
342 const std::array <
const ITensor *, 1 +
sizeof...(Ts) > tensors_info_array{ { tensor1, std::forward<Ts>(tensors)... } };
347 function, file, line,
"Tensor shape has mismatch dimensions for sub-sampling");
351 #define ARM_COMPUTE_ERROR_ON_TENSORS_NOT_SUBSAMPLED(...) \ 352 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_tensors_not_subsampled(__func__, __FILE__, __LINE__, __VA_ARGS__)) 353 #define ARM_COMPUTE_RETURN_ERROR_ON_TENSORS_NOT_SUBSAMPLED(...) \ 354 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_tensors_not_subsampled(__func__, __FILE__, __LINE__, __VA_ARGS__)) 367 template <
typename... Ts>
384 template <
typename... Ts>
402 template <
typename... Ts>
404 unsigned int upper_dim,
const ITensorInfo *tensor_info_1,
const ITensorInfo *tensor_info_2, Ts... tensor_infos)
410 const std::array <
const ITensorInfo *, 2 +
sizeof...(Ts) > tensors_info_array{ { tensor_info_1, tensor_info_2, std::forward<Ts>(tensor_infos)... } };
415 function, file, line,
"Tensors have different shapes");
430 template <
typename... Ts>
432 unsigned int upper_dim,
const ITensor *tensor_1,
const ITensor *tensor_2, Ts... tensors)
441 #define ARM_COMPUTE_ERROR_ON_MISMATCHING_SHAPES(...) \ 442 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_shapes(__func__, __FILE__, __LINE__, __VA_ARGS__)) 443 #define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(...) \ 444 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_mismatching_shapes(__func__, __FILE__, __LINE__, __VA_ARGS__)) 456 template <
typename... Ts>
458 const ITensorInfo *tensor_info, Ts... tensor_infos)
464 const std::array<
const ITensorInfo *,
sizeof...(Ts)> tensors_infos_array{ { std::forward<Ts>(tensor_infos)... } };
467 return tensor_info_obj->data_layout() != tensor_data_layout;
469 function, file, line,
"Tensors have different data layouts");
482 template <
typename... Ts>
484 const ITensor *tensor, Ts... tensors)
492 #define ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_LAYOUT(...) \ 493 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_data_layouts(__func__, __FILE__, __LINE__, __VA_ARGS__)) 494 #define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_LAYOUT(...) \ 495 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_mismatching_data_layouts(__func__, __FILE__, __LINE__, __VA_ARGS__)) 507 template <
typename... Ts>
509 const ITensorInfo *tensor_info, Ts... tensor_infos)
515 const std::array<
const ITensorInfo *,
sizeof...(Ts)> tensors_infos_array{ { std::forward<Ts>(tensor_infos)... } };
518 return tensor_info_obj->data_type() != tensor_data_type;
520 function, file, line,
"Tensors have different data types");
533 template <
typename... Ts>
535 const ITensor *tensor, Ts... tensors)
543 #define ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(...) \ 544 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_data_types(__func__, __FILE__, __LINE__, __VA_ARGS__)) 545 #define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...) \ 546 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_mismatching_data_types(__func__, __FILE__, __LINE__, __VA_ARGS__)) 561 template <
typename... Ts>
573 const std::array <
const ITensorInfo *, 1 +
sizeof...(Ts) > tensor_infos_array{ { tensor_info_2, std::forward<Ts>(tensor_infos)... } };
576 return tensor_info->data_type() != first_data_type;
578 function, file, line,
"Tensors have different asymmetric quantized data types");
581 return tensor_info->quantization_info() != first_quantization_info;
583 function, file, line,
"Tensors have different quantization information");
600 template <
typename... Ts>
608 #define ARM_COMPUTE_ERROR_ON_MISMATCHING_QUANTIZATION_INFO(...) \ 609 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_quantization_info(__func__, __FILE__, __LINE__, __VA_ARGS__)) 610 #define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_QUANTIZATION_INFO(...) \ 611 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_mismatching_quantization_info(__func__, __FILE__, __LINE__, __VA_ARGS__)) 622 template <
typename T,
typename F,
typename... Fs>
624 const T *
object, F &&format, Fs &&... formats)
628 Format &&object_format =
object->info()->format();
633 const std::array<F,
sizeof...(Fs)> formats_array{ { std::forward<Fs>(formats)... } };
638 return f == object_format;
640 function, file, line,
"Format %s not supported by this kernel",
string_from_format(object_format).c_str());
643 #define ARM_COMPUTE_ERROR_ON_FORMAT_NOT_IN(t, ...) ::arm_compute::error_on_format_not_in(__func__, __FILE__, __LINE__, t, __VA_ARGS__) 656 template <
typename T,
typename... Ts>
665 const std::array<T,
sizeof...(Ts)> dts_array{ { std::forward<Ts>(dts)... } };
668 return d == tensor_dt;
670 function, file, line,
"ITensor data type %s not supported by this kernel",
string_from_data_type(tensor_dt).c_str());
684 template <
typename T,
typename... Ts>
686 const ITensor *tensor, T &&
dt, Ts &&... dts)
692 #define ARM_COMPUTE_ERROR_ON_DATA_TYPE_NOT_IN(t, ...) \ 693 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_data_type_not_in(__func__, __FILE__, __LINE__, t, __VA_ARGS__)) 694 #define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_NOT_IN(t, ...) \ 695 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_data_type_not_in(__func__, __FILE__, __LINE__, t, __VA_ARGS__)) 708 template <
typename T,
typename... Ts>
717 const std::array<T,
sizeof...(Ts)> dls_array{ { std::forward<Ts>(dls)... } };
720 return l == tensor_dl;
722 function, file, line,
"ITensor data layout %s not supported by this kernel",
string_from_data_layout(tensor_dl).c_str());
736 template <
typename T,
typename... Ts>
738 const ITensor *tensor, T &&
dl, Ts &&... dls)
744 #define ARM_COMPUTE_ERROR_ON_DATA_LAYOUT_NOT_IN(t, ...) \ 745 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_data_layout_not_in(__func__, __FILE__, __LINE__, t, __VA_ARGS__)) 746 #define ARM_COMPUTE_RETURN_ERROR_ON_DATA_LAYOUT_NOT_IN(t, ...) \ 747 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_data_layout_not_in(__func__, __FILE__, __LINE__, t, __VA_ARGS__)) 761 template <
typename T,
typename... Ts>
763 const ITensorInfo *tensor_info,
size_t num_channels, T &&
dt, Ts &&... dts)
782 template <
typename T,
typename... Ts>
784 const ITensor *tensor,
size_t num_channels, T &&
dt, Ts &&... dts)
790 #define ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c, ...) \ 791 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_data_type_channel_not_in(__func__, __FILE__, __LINE__, t, c, __VA_ARGS__)) 792 #define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c, ...) \ 793 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_data_type_channel_not_in(__func__, __FILE__, __LINE__, t, c, __VA_ARGS__)) 806 const ITensorInfo *tensor_info,
bool is_fp16_supported)
810 function, file, line,
"FP16 not supported by the device");
825 const ITensor *tensor,
bool is_fp16_supported)
856 #define ARM_COMPUTE_ERROR_ON_TENSOR_NOT_2D(t) \ 857 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_tensor_not_2d(__func__, __FILE__, __LINE__, t)) 858 #define ARM_COMPUTE_RETURN_ERROR_ON_TENSOR_NOT_2D(t) \ 859 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_tensor_not_2d(__func__, __FILE__, __LINE__, t)) 872 template <
typename T,
typename... Ts>
874 T cn, T &&channel, Ts &&... channels)
878 const std::array<T,
sizeof...(Ts)> channels_array{ { std::forward<Ts>(channels)... } };
883 function, file, line);
886 #define ARM_COMPUTE_ERROR_ON_CHANNEL_NOT_IN(c, ...) \ 887 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_channel_not_in(__func__, __FILE__, __LINE__, c, __VA_ARGS__)) 888 #define ARM_COMPUTE_RETURN_ERROR_ON_CHANNEL_NOT_IN(c, ...) \ 889 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_channel_not_in(__func__, __FILE__, __LINE__, c, __VA_ARGS__)) 903 #define ARM_COMPUTE_ERROR_ON_CHANNEL_NOT_IN_KNOWN_FORMAT(f, c) \ 904 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_channel_not_in_known_format(__func__, __FILE__, __LINE__, f, c)) 905 #define ARM_COMPUTE_RETURN_ERROR_ON_CHANNEL_NOT_IN_KNOWN_FORMAT(f, c) \ 906 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_channel_not_in_known_format(__func__, __FILE__, __LINE__, f, c)) 924 const IMultiHOG *multi_hog);
925 #define ARM_COMPUTE_ERROR_ON_INVALID_MULTI_HOG(m) \ 926 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_invalid_multi_hog(__func__, __FILE__, __LINE__, m)) 927 #define ARM_COMPUTE_RETURN_ERROR_ON_INVALID_MULTI_HOG(m) \ 928 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_invalid_multi_hog(__func__, __FILE__, __LINE__, m)) 940 const IKernel *kernel);
941 #define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k) \ 942 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_unconfigured_kernel(__func__, __FILE__, __LINE__, k)) 943 #define ARM_COMPUTE_RETURN_ERROR_ON_UNCONFIGURED_KERNEL(k) \ 944 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_unconfigured_kernel(__func__, __FILE__, __LINE__, k)) 958 const TensorShape &parent_shape,
const Coordinates &coords,
const TensorShape &
shape);
959 #define ARM_COMPUTE_ERROR_ON_INVALID_SUBTENSOR(p, c, s) \ 960 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_invalid_subtensor(__func__, __FILE__, __LINE__, p, c, s)) 961 #define ARM_COMPUTE_RETURN_ERROR_ON_INVALID_SUBTENSOR(p, c, s) \ 962 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_invalid_subtensor(__func__, __FILE__, __LINE__, p, c, s)) 975 const ValidRegion &parent_valid_region,
const ValidRegion &
valid_region);
976 #define ARM_COMPUTE_ERROR_ON_INVALID_SUBTENSOR_VALID_REGION(pv, sv) \ 977 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_invalid_subtensor_valid_region(__func__, __FILE__, __LINE__, pv, sv)) 978 #define ARM_COMPUTE_RETURN_ERROR_ON_INVALID_SUBTENSOR_VALID_REGION(pv, sv) \ 979 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_invalid_subtensor_valid_region(__func__, __FILE__, __LINE__, pv, sv)) #define ARM_COMPUTE_ERROR_ON_LOC_MSG(cond, func, file, line,...)
bool is_data_type_quantized(DataType dt)
Check if a given data type is of quantized type.
arm_compute::Status error_on_channel_not_in_known_format(const char *function, const char *file, const int line, Format fmt, Channel cn)
Return an error if the channel is not in format.
#define ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG(cond, func, file, line, msg)
If the condition is true, an error is thrown.
TensorShape calculate_subsampled_shape(const TensorShape &shape, Format format, Channel channel=Channel::UNKNOWN)
Calculate subsampled shape for a given format and channel.
arm_compute::Status error_on_unconfigured_kernel(const char *function, const char *file, const int line, const IKernel *kernel)
Return an error if the kernel is not configured.
arm_compute::Status error_on_window_dimensions_gte(const char *function, const char *file, const int line, const Window &win, unsigned int max_dim)
Return an error if the passed window has too many dimensions.
#define ARM_COMPUTE_RETURN_ERROR_ON_LOC(cond, func, file, line)
If the condition is true, an error is returned.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
arm_compute::Status error_on_nullptr(const char *function, const char *file, const int line, Ts &&... pointers)
Create an error if one of the pointers is a nullptr.
arm_compute::Status error_on_unsupported_fp16(const char *function, const char *file, const int line, const ITensorInfo *tensor_info, bool is_fp16_supported)
Return an error if the data type of the passed tensor info is FP16 and FP16 extension is not supporte...
Store the tensor's metadata.
arm_compute::Status error_on_tensor_not_2d(const char *function, const char *file, const int line, const ITensor *tensor)
Return an error if the tensor is not 2D.
arm_compute::Status error_on_data_layout_not_in(const char *function, const char *file, const int line, const ITensorInfo *tensor_info, T &&dl, Ts &&... dls)
Return an error if the data layout of the passed tensor info does not match any of the data layouts p...
const ValidRegion valid_region
Interface for Neon tensor.
Copyright (c) 2017-2021 Arm Limited.
arm_compute::Status error_on_mismatching_shapes(const char *function, const char *file, const int line, const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos)
Return an error if the passed two tensor infos have different shapes from the given dimension...
Function to compare two Dimensions objects and throw an error on mismatch.
1 channel, 1 F16 per channel
arm_compute::Status for_each_error(F &&)
arm_compute::Status error_on_tensors_not_even(const char *function, const char *file, int line, const Format &format, const ITensor *tensor1, Ts... tensors)
Return an error if the passed tensor objects are not even.
Get the info for a tensor, dummy struct.
Quantization information.
arm_compute::Status error_on_mismatching_quantization_info(const char *function, const char *file, const int line, const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos)
Return an error if the passed tensor infos have different asymmetric quantized data types or differen...
const std::string & string_from_data_type(DataType dt)
Convert a data type identity into a string.
arm_compute::Status error_on_mismatching_windows(const char *function, const char *file, const int line, const Window &full, const Window &win)
Return an error if the passed window is invalid.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Channel
Available channels.
Format
Image colour formats.
arm_compute::Status error_on_channel_not_in(const char *function, const char *file, const int line, T cn, T &&channel, Ts &&... channels)
Return an error if the channel is not in channels.
arm_compute::Status error_on_mismatching_dimensions(const char *function, const char *file, int line, const Dimensions< T > &dim1, const Dimensions< T > &dim2, Ts &&... dims)
Return an error if the passed dimension objects differ.
arm_compute::Status error_on_tensors_not_subsampled(const char *function, const char *file, int line, const Format &format, const TensorShape &shape, const ITensor *tensor1, Ts... tensors)
Return an error if the passed tensor objects are not sub-sampled.
ITensorInfo * operator()(const ITensor *tensor)
Get the info for a tensor.
Dimensions with dimensionality.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
bool have_different_dimensions(const Dimensions< T > &dim1, const Dimensions< T > &dim2, unsigned int upper_dim)
virtual QuantizationInfo quantization_info() const =0
Get the quantization settings (scale and offset) of the tensor.
#define ARM_COMPUTE_ERROR_ON_LOC(cond, func, file, line)
If the condition is true then an error message is printed and an exception thrown.
#define ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG_VAR(cond, func, file, line, msg,...)
If the condition is true, an error is thrown.
TensorShape adjust_odd_shape(const TensorShape &shape, Format format)
Adjust tensor shape size if width or height are odd for a given multi-planar format.
Get the info for a tensor.
arm_compute::Status error_on_invalid_subtensor(const char *function, const char *file, const int line, const TensorShape &parent_shape, const Coordinates &coords, const TensorShape &shape)
Return an error if if the coordinates and shape of the subtensor are within the parent tensor...
arm_compute::Status operator()(const Dimensions< T > &dim)
Compare the given object against the stored one.
const std::string & string_from_data_layout(DataLayout dl)
Convert a data layout identity into a string.
arm_compute::Status error_on_mismatching_data_types(const char *function, const char *file, const int line, const ITensorInfo *tensor_info, Ts... tensor_infos)
Return an error if the passed two tensor infos have different data types.
arm_compute::Status error_on_data_type_not_in(const char *function, const char *file, const int line, const ITensorInfo *tensor_info, T &&dt, Ts &&... dts)
Return an error if the data type of the passed tensor info does not match any of the data types provi...
arm_compute::Status error_on_invalid_multi_hog(const char *function, const char *file, const int line, const IMultiHOG *multi_hog)
Return an error if the IMultiHOG container is invalid.
arm_compute::Status error_on_data_type_channel_not_in(const char *function, const char *file, const int line, const ITensorInfo *tensor_info, size_t num_channels, T &&dt, Ts &&... dts)
Return an error if the data type or the number of channels of the passed tensor info does not match a...
arm_compute::Status error_on_mismatching_data_layouts(const char *function, const char *file, const int line, const ITensorInfo *tensor_info, Ts... tensor_infos)
Return an error if the passed tensor infos have different data layouts.
DataType
Available data types.
compare_dimension(const Dimensions< T > &dim, const char *function, const char *file, int line)
Construct a comparison function.
DataLayout
[DataLayout enum definition]
arm_compute::Status error_on_coordinates_dimensions_gte(const char *function, const char *file, const int line, const Coordinates &pos, unsigned int max_dim)
Return an error if the passed coordinates have too many dimensions.
arm_compute::Status error_on_invalid_subwindow(const char *function, const char *file, const int line, const Window &full, const Window &sub)
Return an error if the passed subwindow is invalid.
arm_compute::Status error_on_invalid_subtensor_valid_region(const char *function, const char *file, const int line, const ValidRegion &parent_valid_region, const ValidRegion &valid_region)
Return an error if the valid region of a subtensor is not inside the valid region of the parent tenso...
virtual size_t num_channels() const =0
The number of channels for each tensor element.
void error_on_format_not_in(const char *function, const char *file, const int line, const T *object, F &&format, Fs &&... formats)
Throw an error if the format of the passed tensor/multi-image does not match any of the formats provi...
virtual DataLayout data_layout() const =0
Get the data layout of the tensor.
const std::string & string_from_format(Format format)
Convert a tensor format into a string.
arm_compute::Status error_on_window_not_collapsable_at_dimension(const char *function, const char *file, const int line, const Window &full, const Window &window, const int dim)
Return an error if the window can't be collapsed at the given dimension.