24 #ifndef ARM_COMPUTE_VALIDATE_H 25 #define ARM_COMPUTE_VALIDATE_H 49 for(
unsigned int i = upper_dim; i < arm_compute::Dimensions<T>::num_max_dimensions; ++i)
51 if(dim1[i] != dim2[i])
79 : _dim{ dim }, _function{
function }, _file{ file }, _line{ line }
92 "Objects have different dimensions");
98 const char *
const _function;
99 const char *
const _file;
103 template <
typename F>
109 template <
typename F,
typename T,
typename... Ts>
118 template <
typename T>
132 return tensor->
info();
146 template <
typename... Ts>
149 const std::array<
const void *,
sizeof...(Ts)> pointers_array{ { std::forward<Ts>(pointers)... } };
150 bool has_nullptr = std::any_of(pointers_array.begin(), pointers_array.end(), [&](
const void *ptr)
152 return (ptr ==
nullptr);
157 #define ARM_COMPUTE_ERROR_ON_NULLPTR(...) \ 158 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_nullptr(__func__, __FILE__, __LINE__, __VA_ARGS__)) 159 #define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...) \ 160 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_nullptr(__func__, __FILE__, __LINE__, __VA_ARGS__)) 178 const Window &full,
const Window &win);
179 #define ARM_COMPUTE_ERROR_ON_MISMATCHING_WINDOWS(f, w) \ 180 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_windows(__func__, __FILE__, __LINE__, f, w)) 181 #define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_WINDOWS(f, w) \ 182 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_mismatching_windows(__func__, __FILE__, __LINE__, f, w)) 200 const Window &full,
const Window &sub);
201 #define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s) \ 202 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_invalid_subwindow(__func__, __FILE__, __LINE__, f, s)) 203 #define ARM_COMPUTE_RETURN_ERROR_ON_INVALID_SUBWINDOW(f, s) \ 204 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_invalid_subwindow(__func__, __FILE__, __LINE__, f, s)) 220 const Window &full,
const Window &window,
const int dim);
221 #define ARM_COMPUTE_ERROR_ON_WINDOW_NOT_COLLAPSABLE_AT_DIMENSION(f, w, d) \ 222 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_window_not_collapsable_at_dimension(__func__, __FILE__, __LINE__, f, w, d)) 223 #define ARM_COMPUTE_RETURN_ERROR_ON_WINDOW_NOT_COLLAPSABLE_AT_DIMENSION(f, w, d) \ 224 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_window_not_collapsable_at_dimension(__func__, __FILE__, __LINE__, f, w, d)) 239 const Coordinates &pos,
unsigned int max_dim);
240 #define ARM_COMPUTE_ERROR_ON_COORDINATES_DIMENSIONS_GTE(p, md) \ 241 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_coordinates_dimensions_gte(__func__, __FILE__, __LINE__, p, md)) 242 #define ARM_COMPUTE_RETURN_ERROR_ON_COORDINATES_DIMENSIONS_GTE(p, md) \ 243 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_coordinates_dimensions_gte(__func__, __FILE__, __LINE__, p, md)) 258 const Window &win,
unsigned int max_dim);
259 #define ARM_COMPUTE_ERROR_ON_WINDOW_DIMENSIONS_GTE(w, md) \ 260 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_window_dimensions_gte(__func__, __FILE__, __LINE__, w, md)) 261 #define ARM_COMPUTE_RETURN_ERROR_ON_WINDOW_DIMENSIONS_GTE(w, md) \ 262 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_window_dimensions_gte(__func__, __FILE__, __LINE__, w, md)) 275 template <
typename T,
typename... Ts>
282 #define ARM_COMPUTE_ERROR_ON_MISMATCHING_DIMENSIONS(...) \ 283 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_dimensions(__func__, __FILE__, __LINE__, __VA_ARGS__)) 284 #define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(...) \ 285 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_mismatching_dimensions(__func__, __FILE__, __LINE__, __VA_ARGS__)) 298 template <
typename... Ts>
304 const std::array <
const ITensor *, 1 +
sizeof...(Ts) > tensors_info_array{ { tensor1, std::forward<Ts>(tensors)... } };
310 function, file, line,
"Tensor shape has odd dimensions");
314 #define ARM_COMPUTE_ERROR_ON_TENSORS_NOT_EVEN(...) \ 315 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_tensors_not_even(__func__, __FILE__, __LINE__, __VA_ARGS__)) 316 #define ARM_COMPUTE_RETURN_ERROR_ON_TENSORS_NOT_EVEN(...) \ 317 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_tensors_not_even(__func__, __FILE__, __LINE__, __VA_ARGS__)) 331 template <
typename... Ts>
338 const std::array <
const ITensor *, 1 +
sizeof...(Ts) > tensors_info_array{ { tensor1, std::forward<Ts>(tensors)... } };
343 function, file, line,
"Tensor shape has mismatch dimensions for sub-sampling");
347 #define ARM_COMPUTE_ERROR_ON_TENSORS_NOT_SUBSAMPLED(...) \ 348 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_tensors_not_subsampled(__func__, __FILE__, __LINE__, __VA_ARGS__)) 349 #define ARM_COMPUTE_RETURN_ERROR_ON_TENSORS_NOT_SUBSAMPLED(...) \ 350 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_tensors_not_subsampled(__func__, __FILE__, __LINE__, __VA_ARGS__)) 363 template <
typename... Ts>
380 template <
typename... Ts>
398 template <
typename... Ts>
400 unsigned int upper_dim,
const ITensorInfo *tensor_info_1,
const ITensorInfo *tensor_info_2, Ts... tensor_infos)
406 const std::array <
const ITensorInfo *, 2 +
sizeof...(Ts) > tensors_info_array{ { tensor_info_1, tensor_info_2, std::forward<Ts>(tensor_infos)... } };
411 function, file, line,
"Tensors have different shapes");
426 template <
typename... Ts>
428 unsigned int upper_dim,
const ITensor *tensor_1,
const ITensor *tensor_2, Ts... tensors)
437 #define ARM_COMPUTE_ERROR_ON_MISMATCHING_SHAPES(...) \ 438 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_shapes(__func__, __FILE__, __LINE__, __VA_ARGS__)) 439 #define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(...) \ 440 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_mismatching_shapes(__func__, __FILE__, __LINE__, __VA_ARGS__)) 452 template <
typename... Ts>
454 const ITensorInfo *tensor_info, Ts... tensor_infos)
460 const std::array<
const ITensorInfo *,
sizeof...(Ts)> tensors_infos_array{ { std::forward<Ts>(tensor_infos)... } };
463 return tensor_info_obj->data_layout() != tensor_data_layout;
465 function, file, line,
"Tensors have different data layouts");
478 template <
typename... Ts>
480 const ITensor *tensor, Ts... tensors)
488 #define ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_LAYOUT(...) \ 489 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_data_layouts(__func__, __FILE__, __LINE__, __VA_ARGS__)) 490 #define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_LAYOUT(...) \ 491 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_mismatching_data_layouts(__func__, __FILE__, __LINE__, __VA_ARGS__)) 503 template <
typename... Ts>
505 const ITensorInfo *tensor_info, Ts... tensor_infos)
511 const std::array<
const ITensorInfo *,
sizeof...(Ts)> tensors_infos_array{ { std::forward<Ts>(tensor_infos)... } };
514 return tensor_info_obj->data_type() != tensor_data_type;
516 function, file, line,
"Tensors have different data types");
529 template <
typename... Ts>
531 const ITensor *tensor, Ts... tensors)
539 #define ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(...) \ 540 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_data_types(__func__, __FILE__, __LINE__, __VA_ARGS__)) 541 #define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...) \ 542 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_mismatching_data_types(__func__, __FILE__, __LINE__, __VA_ARGS__)) 557 template <
typename... Ts>
569 const std::array <
const ITensorInfo *, 1 +
sizeof...(Ts) > tensor_infos_array{ { tensor_info_2, std::forward<Ts>(tensor_infos)... } };
572 return tensor_info->data_type() != first_data_type;
574 function, file, line,
"Tensors have different asymmetric quantized data types");
577 return tensor_info->quantization_info() != first_quantization_info;
579 function, file, line,
"Tensors have different quantization information");
596 template <
typename... Ts>
604 #define ARM_COMPUTE_ERROR_ON_MISMATCHING_QUANTIZATION_INFO(...) \ 605 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_quantization_info(__func__, __FILE__, __LINE__, __VA_ARGS__)) 606 #define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_QUANTIZATION_INFO(...) \ 607 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_mismatching_quantization_info(__func__, __FILE__, __LINE__, __VA_ARGS__)) 618 template <
typename T,
typename F,
typename... Fs>
620 const T *
object, F &&format, Fs &&... formats)
624 Format &&object_format =
object->info()->format();
629 const std::array<F,
sizeof...(Fs)> formats_array{ { std::forward<Fs>(formats)... } };
634 return f == object_format;
636 function, file, line,
"Format %s not supported by this kernel",
string_from_format(object_format).c_str());
639 #define ARM_COMPUTE_ERROR_ON_FORMAT_NOT_IN(t, ...) ::arm_compute::error_on_format_not_in(__func__, __FILE__, __LINE__, t, __VA_ARGS__) 652 template <
typename T,
typename... Ts>
661 const std::array<T,
sizeof...(Ts)> dts_array{ { std::forward<Ts>(dts)... } };
664 return d == tensor_dt;
666 function, file, line,
"ITensor data type %s not supported by this kernel",
string_from_data_type(tensor_dt).c_str());
680 template <
typename T,
typename... Ts>
682 const ITensor *tensor, T &&
dt, Ts &&... dts)
688 #define ARM_COMPUTE_ERROR_ON_DATA_TYPE_NOT_IN(t, ...) \ 689 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_data_type_not_in(__func__, __FILE__, __LINE__, t, __VA_ARGS__)) 690 #define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_NOT_IN(t, ...) \ 691 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_data_type_not_in(__func__, __FILE__, __LINE__, t, __VA_ARGS__)) 704 template <
typename T,
typename... Ts>
713 const std::array<T,
sizeof...(Ts)> dls_array{ { std::forward<Ts>(dls)... } };
716 return l == tensor_dl;
718 function, file, line,
"ITensor data layout %s not supported by this kernel",
string_from_data_layout(tensor_dl).c_str());
732 template <
typename T,
typename... Ts>
734 const ITensor *tensor, T &&
dl, Ts &&... dls)
740 #define ARM_COMPUTE_ERROR_ON_DATA_LAYOUT_NOT_IN(t, ...) \ 741 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_data_layout_not_in(__func__, __FILE__, __LINE__, t, __VA_ARGS__)) 742 #define ARM_COMPUTE_RETURN_ERROR_ON_DATA_LAYOUT_NOT_IN(t, ...) \ 743 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_data_layout_not_in(__func__, __FILE__, __LINE__, t, __VA_ARGS__)) 757 template <
typename T,
typename... Ts>
759 const ITensorInfo *tensor_info,
size_t num_channels, T &&
dt, Ts &&... dts)
778 template <
typename T,
typename... Ts>
780 const ITensor *tensor,
size_t num_channels, T &&
dt, Ts &&... dts)
786 #define ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c, ...) \ 787 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_data_type_channel_not_in(__func__, __FILE__, __LINE__, t, c, __VA_ARGS__)) 788 #define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c, ...) \ 789 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_data_type_channel_not_in(__func__, __FILE__, __LINE__, t, c, __VA_ARGS__)) 802 const ITensorInfo *tensor_info,
bool is_fp16_supported)
806 function, file, line,
"FP16 not supported by the device");
821 const ITensor *tensor,
bool is_fp16_supported)
852 #define ARM_COMPUTE_ERROR_ON_TENSOR_NOT_2D(t) \ 853 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_tensor_not_2d(__func__, __FILE__, __LINE__, t)) 854 #define ARM_COMPUTE_RETURN_ERROR_ON_TENSOR_NOT_2D(t) \ 855 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_tensor_not_2d(__func__, __FILE__, __LINE__, t)) 868 template <
typename T,
typename... Ts>
870 T cn, T &&channel, Ts &&... channels)
874 const std::array<T,
sizeof...(Ts)> channels_array{ { std::forward<Ts>(channels)... } };
879 function, file, line);
882 #define ARM_COMPUTE_ERROR_ON_CHANNEL_NOT_IN(c, ...) \ 883 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_channel_not_in(__func__, __FILE__, __LINE__, c, __VA_ARGS__)) 884 #define ARM_COMPUTE_RETURN_ERROR_ON_CHANNEL_NOT_IN(c, ...) \ 885 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_channel_not_in(__func__, __FILE__, __LINE__, c, __VA_ARGS__)) 899 #define ARM_COMPUTE_ERROR_ON_CHANNEL_NOT_IN_KNOWN_FORMAT(f, c) \ 900 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_channel_not_in_known_format(__func__, __FILE__, __LINE__, f, c)) 901 #define ARM_COMPUTE_RETURN_ERROR_ON_CHANNEL_NOT_IN_KNOWN_FORMAT(f, c) \ 902 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_channel_not_in_known_format(__func__, __FILE__, __LINE__, f, c)) 914 const IKernel *kernel);
915 #define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k) \ 916 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_unconfigured_kernel(__func__, __FILE__, __LINE__, k)) 917 #define ARM_COMPUTE_RETURN_ERROR_ON_UNCONFIGURED_KERNEL(k) \ 918 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_unconfigured_kernel(__func__, __FILE__, __LINE__, k)) 932 const TensorShape &parent_shape,
const Coordinates &coords,
const TensorShape &
shape);
933 #define ARM_COMPUTE_ERROR_ON_INVALID_SUBTENSOR(p, c, s) \ 934 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_invalid_subtensor(__func__, __FILE__, __LINE__, p, c, s)) 935 #define ARM_COMPUTE_RETURN_ERROR_ON_INVALID_SUBTENSOR(p, c, s) \ 936 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_invalid_subtensor(__func__, __FILE__, __LINE__, p, c, s)) 949 const ValidRegion &parent_valid_region,
const ValidRegion &
valid_region);
950 #define ARM_COMPUTE_ERROR_ON_INVALID_SUBTENSOR_VALID_REGION(pv, sv) \ 951 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_invalid_subtensor_valid_region(__func__, __FILE__, __LINE__, pv, sv)) 952 #define ARM_COMPUTE_RETURN_ERROR_ON_INVALID_SUBTENSOR_VALID_REGION(pv, sv) \ 953 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 CPU 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_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.