Compute Library
 23.11
arm_compute::test Namespace Reference

Namespaces

 benchmark
 
 colorconvert_helper
 
 convolution_3d
 
 detail
 
 framework
 
 traits
 
 validation
 

Data Structures

class  Accessor
 Accessor implementation for Tensor objects. More...
 
class  ArrayAccessor
 ArrayAccessor implementation for Array objects. More...
 
class  AssetsLibrary
 Factory class to create and fill tensors. More...
 
class  CLAccessor
 Accessor implementation for CLTensor objects. More...
 
class  CLArrayAccessor
 Accessor implementation for CLArray objects. More...
 
class  CLSynthetizeFunction
 This template synthetizes an ICLSimpleFunction which runs the given kernel K. More...
 
class  CLSynthetizeFunctionInitOutputWithZeroAndWithZeroConstantBorder
 As above but this also initializes to zero the input tensor. More...
 
class  CLSynthetizeFunctionWithZeroConstantBorder
 As above but this also setups a Zero border on the input tensor of the specified bordersize. More...
 
class  CLSynthetizeOperator
 This template synthetizes a simple IOperator which runs the given kernel K. More...
 
class  CLSynthetizeOperatorInitOutputWithZeroAndWithZeroConstantBorder
 As above but this also initializes to zero the input tensor. More...
 
class  ClSynthetizeOperatorWithBorder
 As above but this also setups a Zero border on the input tensor of the kernel's bordersize. More...
 
struct  common_promoted_signed_type
 Find the signed promoted common type. More...
 
struct  common_promoted_unsigned_type
 Find the unsigned promoted common type. More...
 
class  ContextSchedulerUser
 
struct  ContextType
 
struct  ContextType< Tensor >
 
class  IAccessor
 Common interface to provide information and access to tensor like structures. More...
 
class  IArrayAccessor
 Common interface to provide information and access to array like structures. More...
 
class  NESynthetizeFunction
 This template synthetizes an INESimpleFunction which runs the given kernel K. More...
 
class  NESynthetizeFunctionWithZeroConstantBorder
 As above but this also setups a Zero border on the input tensor of the specified bordersize. More...
 
class  NESynthetizeFunctionWithZeroConstantKernelBorder
 As above but this also setups a Zero border on the input tensor of the kernel's bordersize. More...
 
class  PaddingCalculator
 Calculate required padding. More...
 
class  ParametersLibrary
 Class that contains all the global parameters used by the tests. More...
 
class  RawTensor
 Subclass of SimpleTensor using uint8_t as value type. More...
 
class  SimpleTensor
 Simple tensor object that stores elements in a consecutive chunk of memory. More...
 
class  SimpleTensorAccessor
 Accessor implementation for SimpleTensor objects. More...
 
class  TensorCache
 Stores RawTensor categorised by the image they are created from including name, format and channel. More...
 

Functions

template<typename O , typename F , typename... As>
void apply (O *obj, F &&func, const std::tuple< As... > &args)
 
template<typename T , typename std::enable_if< std::is_same< typename T::value_type, std::string >::value, int >::type = 0>
std::string join (T first, T last, const std::string &separator)
 Helper function to concatenate multiple strings. More...
 
template<typename T , typename UnaryOp >
std::string join (T &&first, T &&last, const std::string &separator, UnaryOp &&op)
 Helper function to concatenate multiple values. More...
 
template<typename T , typename std::enable_if< std::is_arithmetic< typename T::value_type >::value, int >::type = 0>
std::string join (T &&first, T &&last, const std::string &separator)
 Helper function to concatenate multiple values. More...
 
std::string tolower (std::string string)
 Convert string to lower case. More...
 
template<typename T , typename std::enable_if< std::is_arithmetic< T >::value, int >::type = 0>
std::string arithmetic_to_string (T val, int decimal_places=0)
 Create a string with the arithmetic value in full precision. More...
 
void sleep_in_seconds (float seconds)
 Makes the calling thread to sleep for a specified number of seconds. More...
 
template<typename D , typename T , typename... Ts>
void fill_tensors (D &&dist, std::initializer_list< int > seeds, T &&tensor, Ts &&... other_tensors)
 
template<typename T1 , typename T2 >
SimpleTensor< T1 > copy_tensor (const SimpleTensor< T2 > &tensor)
 
template<typename T1 , typename T2 , typename std::enable_if< std::is_same< T1, T2 >::value, int >::type = 0>
SimpleTensor< T1 > copy_tensor (const SimpleTensor< half > &tensor)
 
template<typename U >
void swap (SimpleTensor< U > &tensor1, SimpleTensor< U > &tensor2)
 
template<typename T >
std::string prettify_tensor (const SimpleTensor< T > &input, const IOFormatInfo &io_fmt=IOFormatInfo{ IOFormatInfo::PrintRegion::NoPadding })
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const SimpleTensor< T > &tensor)
 
template<typename T >
std::string to_string (const SimpleTensor< T > &tensor)
 
template<typename T , typename = typename std::enable_if<std::is_floating_point<T>::value>::type>
round_half_up (T value)
 Round floating-point value with half value rounding to positive infinity. More...
 
template<typename T , typename = typename std::enable_if<std::is_floating_point<T>::value>::type>
round_half_even (T value, T epsilon=std::numeric_limits< T >::epsilon())
 Round floating-point value with half value rounding to nearest even. More...
 
Format get_format_for_channel (Channel channel)
 Look up the format corresponding to a channel. More...
 
Format get_channel_format (Channel channel)
 Return the format of a channel. More...
 
template<typename F , typename T >
foldl (F &&, const T &value)
 Base case of foldl. More...
 
template<typename F , typename T , typename U >
auto foldl (F &&func, T &&value1, U &&value2) -> decltype(func(value1, value2))
 Base case of foldl. More...
 
template<typename F , typename I , typename T , typename... Vs>
foldl (F &&func, I &&initial, T &&value, Vs &&... values)
 Fold left. More...
 
ValidRegion shape_to_valid_region (const TensorShape &a_shape, bool border_undefined=false, BorderSize border_size=BorderSize(0))
 Create a valid region based on tensor shape, border mode and border size. More...
 
template<typename T >
void store_value_with_data_type (void *ptr, T value, DataType data_type)
 Write the value after casting the pointer according to data_type. More...
 
template<typename U , typename T >
saturate_cast (T val)
 Saturate a value of type T against the numeric limits of type U. More...
 
Coordinates index2coord (const TensorShape &shape, int index)
 Convert a linear index into n-dimensional coordinates. More...
 
int coord2index (const TensorShape &shape, const Coordinates &coord)
 Linearise the given coordinate. More...
 
bool is_in_valid_region (const ValidRegion &valid_region, Coordinates coord)
 Check if a coordinate is within a valid region. More...
 
template<typename T >
create_tensor (const TensorInfo &info, IRuntimeContext *ctx=nullptr)
 Create and initialize a tensor of the given type. More...
 
template<typename T >
create_tensor (const TensorShape &shape, DataType data_type, int num_channels=1, QuantizationInfo quantization_info=QuantizationInfo(), DataLayout data_layout=DataLayout::NCHW, IRuntimeContext *ctx=nullptr)
 Create and initialize a tensor of the given type. More...
 
template<typename T >
create_tensor (const TensorShape &shape, Format format, IRuntimeContext *ctx=nullptr)
 Create and initialize a tensor of the given type. More...
 
template<typename T , typename = typename std::enable_if<std::is_floating_point<T>::value>::type>
std::vector< T > generate_random_real (unsigned int num_values, T min, T max, std::random_device::result_type seed)
 Create a vector with a uniform distribution of floating point values across the specified range. More...
 
template<typename T , typename ArrayAccessor_T >
void fill_array (ArrayAccessor_T &&array, const std::vector< T > &v)
 
std::string get_typestring (DataType data_type)
 Obtain numpy type string from DataType. More...
 
template<typename TensorType >
void sync_if_necessary ()
 Sync if necessary. More...
 
template<typename TensorType >
void sync_tensor_if_necessary (TensorType &tensor)
 Sync tensor if necessary. More...
 
ITensorInfo::TensorDimsState construct_dims_state (int32_t value)
 Construct and return object for dimensions' state filled with the given value. More...
 
ITensorInfo::TensorDimsState construct_dynamic_dims_state ()
 Construct and return object for dimensions' state filled with the value for dynamic state. More...
 
ITensorInfo::TensorDimsState construct_static_dims_state ()
 Construct and return object for dimensions' state filled with the value for non-dynamic state. More...
 
template<typename TensorType >
void set_tensor_dynamic (TensorType &t)
 Set the dimension states of the given tensor to dynamic. More...
 
template<typename TensorType >
void set_tensor_static (TensorType &t)
 Set the dimension states of the given tensor to state. More...
 
experimental::dynamic_fusion::Conv2dAttributes convert_pad_stride_info_to_conv_attr (const PadStrideInfo &info, const Size2D &dialation)
 

Variables

std::unique_ptr< ParametersLibraryparameters
 
std::unique_ptr< AssetsLibrarylibrary
 
std::unique_ptr< AssetsLibraryfixed_library
 

Function Documentation

◆ apply()

void arm_compute::test::apply ( O *  obj,
F &&  func,
const std::tuple< As... > &  args 
)

Definition at line 79 of file Utils.h.

80 {
81  detail::apply_impl(obj, std::forward<F>(func), args, detail::sequence_t<sizeof...(As)>());
82 }

References arm_compute::test::framework::apply_impl(), and GemmTuner::args.

◆ arithmetic_to_string()

std::string arm_compute::test::arithmetic_to_string ( val,
int  decimal_places = 0 
)
inline

Create a string with the arithmetic value in full precision.

Parameters
valArithmetic value
decimal_placesHow many decimal places to show
Returns
String with the arithmetic value.

Definition at line 164 of file Utils.h.

165 {
166  std::stringstream ss;
167  ss << std::fixed;
168  ss.precision((decimal_places) ? decimal_places : std::numeric_limits<T>::digits10 + 1);
169  ss << val;
170  return ss.str();
171 }

References arm_compute::test::validation::ss().

Referenced by PrettyPrinter::print_measurements().

◆ construct_dims_state()

ITensorInfo::TensorDimsState arm_compute::test::construct_dims_state ( int32_t  value)
inline

Construct and return object for dimensions' state filled with the given value.

Parameters
[in]valueThe value to fill
Returns
Constructed class

Definition at line 586 of file Utils.h.

587 {
588  auto states = ITensorInfo::TensorDimsState{};
589  std::fill(states.begin(), states.end(), value);
590  return states;
591 }

References arm_compute::test::validation::utils::fill().

Referenced by construct_dynamic_dims_state(), and construct_static_dims_state().

◆ construct_dynamic_dims_state()

ITensorInfo::TensorDimsState arm_compute::test::construct_dynamic_dims_state ( )
inline

Construct and return object for dimensions' state filled with the value for dynamic state.

Returns
Constructed class filled with the value for dynamic state

Definition at line 597 of file Utils.h.

598 {
599  return construct_dims_state(ITensorInfo::get_dynamic_state_value());
600 }

References construct_dims_state(), and ITensorInfo::get_dynamic_state_value().

Referenced by set_tensor_dynamic().

◆ construct_static_dims_state()

ITensorInfo::TensorDimsState arm_compute::test::construct_static_dims_state ( )
inline

Construct and return object for dimensions' state filled with the value for non-dynamic state.

Returns
Constructed class filled with the value for non-dynamic state

Definition at line 606 of file Utils.h.

607 {
608  return construct_dims_state(ITensorInfo::get_static_state_value());
609 }

References construct_dims_state(), and ITensorInfo::get_static_state_value().

Referenced by set_tensor_static().

◆ convert_pad_stride_info_to_conv_attr()

experimental::dynamic_fusion::Conv2dAttributes arm_compute::test::convert_pad_stride_info_to_conv_attr ( const PadStrideInfo info,
const Size2D dialation 
)
inline

Definition at line 633 of file Utils.h.

634 {
635  const Padding2D info_pad(info.pad_left(), info.pad_right(), info.pad_top(), info.pad_bottom());
636  const Size2D info_stride(info.stride().first, info.stride().second);
637  return arm_compute::experimental::dynamic_fusion::Conv2dAttributes().pad(info_pad).stride(info_stride).dilation(dialation);
638 }

References Conv2dAttributes::dilation(), arm_compute::test::validation::info, Conv2dAttributes::pad(), and Conv2dAttributes::stride().

◆ coord2index()

int arm_compute::test::coord2index ( const TensorShape shape,
const Coordinates coord 
)
inline

Linearise the given coordinate.

Transforms the given coordinate into a linear offset in terms of elements.

Parameters
[in]shapeShape of the n-dimensional tensor.
[in]coordThe to be converted coordinate.
Returns
Linear offset to the element.

Definition at line 388 of file Utils.h.

389 {
390  ARM_COMPUTE_ERROR_ON_MSG(shape.total_size() == 0, "Cannot get index from empty shape");
391  ARM_COMPUTE_ERROR_ON_MSG(coord.num_dimensions() == 0, "Cannot get index of empty coordinate");
392 
393  int index = 0;
394  int dim_size = 1;
395 
396  for(unsigned int i = 0; i < coord.num_dimensions(); ++i)
397  {
398  index += coord[i] * dim_size;
399  dim_size *= shape[i];
400  }
401 
402  return index;
403 }

References ARM_COMPUTE_ERROR_ON_MSG, Dimensions< T >::num_dimensions(), and arm_compute::test::validation::shape.

Referenced by arm_compute::test::validation::apply_2d_spatial_filter(), arm_compute::test::validation::reference::col2im(), arm_compute::test::validation::reference::conv3d(), arm_compute::test::validation::reference::instance_normalization(), RawTensor::operator()(), SimpleTensor< uint8_t >::operator()(), arm_compute::test::validation::reference::pad_layer(), arm_compute::test::validation::reference::pooling_3d_layer_internal(), arm_compute::test::validation::reference::pooling_layer_internal(), arm_compute::test::validation::reference::reverse(), arm_compute::test::validation::reference::scale_core(), arm_compute::test::validation::tensor_elem_at(), arm_compute::test::validation::reference::tile(), arm_compute::test::validation::reference::transpose(), and arm_compute::test::validation::reference::weights_reshape().

◆ copy_tensor() [1/2]

SimpleTensor< T1 > copy_tensor ( const SimpleTensor< half > &  tensor)

Definition at line 246 of file SimpleTensor.h.

247 {
248  SimpleTensor<T1> st(tensor.shape(), tensor.data_type(),
249  tensor.num_channels(),
250  tensor.quantization_info(),
251  tensor.data_layout());
252  memcpy((void *)st.data(), (const void *)tensor.data(), size_t(st.num_elements() * sizeof(T1)));
253  return st;
254 }

References SimpleTensor< T >::data(), SimpleTensor< T >::num_elements(), and tensor.

◆ copy_tensor() [2/2]

SimpleTensor<T1> arm_compute::test::copy_tensor ( const SimpleTensor< T2 > &  tensor)

Definition at line 232 of file SimpleTensor.h.

233 {
234  SimpleTensor<T1> st(tensor.shape(), tensor.data_type(),
235  tensor.num_channels(),
236  tensor.quantization_info(),
237  tensor.data_layout());
238  for(size_t n = 0; n < size_t(st.num_elements()); n++)
239  {
240  st.data()[n] = static_cast<T1>(tensor.data()[n]);
241  }
242  return st;
243 }

References SimpleTensor< T >::data(), SimpleTensor< T >::num_elements(), and tensor.

◆ create_tensor() [1/3]

T arm_compute::test::create_tensor ( const TensorInfo info,
IRuntimeContext ctx = nullptr 
)
inline

Create and initialize a tensor of the given type.

Parameters
[in]infoTensor information to be used to create the tensor
[in]ctx(Optional) Pointer to the runtime context.
Returns
Initialized tensor of given type.

Definition at line 427 of file Utils.h.

428 {
429  T tensor(ctx);
430  tensor.allocator()->init(info);
431  return tensor;
432 }

References arm_compute::test::validation::info, and tensor.

◆ create_tensor() [2/3]

T arm_compute::test::create_tensor ( const TensorShape shape,
DataType  data_type,
int  num_channels = 1,
QuantizationInfo  quantization_info = QuantizationInfo(),
DataLayout  data_layout = DataLayout::NCHW,
IRuntimeContext ctx = nullptr 
)
inline

Create and initialize a tensor of the given type.

Parameters
[in]shapeTensor shape.
[in]data_typeData type.
[in]num_channels(Optional) Number of channels.
[in]quantization_info(Optional) Quantization info for asymmetric quantized types.
[in]data_layout(Optional) Data layout. Default is NCHW.
[in]ctx(Optional) Pointer to the runtime context.
Returns
Initialized tensor of given type.

Definition at line 446 of file Utils.h.

448 {
449  T tensor(ctx);
450  TensorInfo info(shape, num_channels, data_type);
451  info.set_quantization_info(quantization_info);
452  info.set_data_layout(data_layout);
453 
454  return create_tensor<T>(info, ctx);
455 }

References arm_compute::cpu::data_layout, arm_compute::test::validation::data_type, arm_compute::test::validation::info, arm_compute::test::validation::shape, and tensor.

◆ create_tensor() [3/3]

T arm_compute::test::create_tensor ( const TensorShape shape,
Format  format,
IRuntimeContext ctx = nullptr 
)
inline

Create and initialize a tensor of the given type.

Parameters
[in]shapeTensor shape.
[in]formatFormat type.
[in]ctx(Optional) Pointer to the runtime context.
Returns
Initialized tensor of given type.

Definition at line 466 of file Utils.h.

467 {
468  TensorInfo info(shape, format);
469 
470  return create_tensor<T>(info, ctx);
471 }

References arm_compute::test::validation::info, and arm_compute::test::validation::shape.

◆ fill_array()

void arm_compute::test::fill_array ( ArrayAccessor_T &&  array,
const std::vector< T > &  v 
)
inline

Definition at line 498 of file Utils.h.

499 {
500  array.resize(v.size());
501  std::memcpy(array.buffer(), v.data(), v.size() * sizeof(T));
502 }

◆ fill_tensors()

void arm_compute::test::fill_tensors ( D &&  dist,
std::initializer_list< int >  seeds,
T &&  tensor,
Ts &&...  other_tensors 
)

Definition at line 45 of file Helper.h.

46 {
47  const std::array < T, 1 + sizeof...(Ts) > tensors{ { std::forward<T>(tensor), std::forward<Ts>(other_tensors)... } };
48  std::vector<int> vs(seeds);
49  ARM_COMPUTE_ERROR_ON(vs.size() != tensors.size());
50  int k = 0;
51  for(auto tp : tensors)
52  {
53  library->fill(Accessor(*tp), std::forward<D>(dist), vs[k++]);
54  }
55 }

References ARM_COMPUTE_ERROR_ON, library, and tensor.

◆ foldl() [1/3]

T arm_compute::test::foldl ( F &&  ,
const T &  value 
)
inline

Base case of foldl.

Returns
value.

Definition at line 182 of file Utils.h.

183 {
184  return value;
185 }

Referenced by foldl().

◆ foldl() [2/3]

I arm_compute::test::foldl ( F &&  func,
I &&  initial,
T &&  value,
Vs &&...  values 
)
inline

Fold left.

Parameters
[in]funcBinary function to be called.
[in]initialInitial value.
[in]valueArgument passed to the function.
[in]valuesRemaining arguments.

Definition at line 205 of file Utils.h.

206 {
207  return foldl(std::forward<F>(func), func(std::forward<I>(initial), std::forward<T>(value)), std::forward<Vs>(values)...);
208 }

References foldl().

◆ foldl() [3/3]

auto arm_compute::test::foldl ( F &&  func,
T &&  value1,
U &&  value2 
) -> decltype(func(value1, value2))
inline

Base case of foldl.

Returns
func(value1, value2).

Definition at line 192 of file Utils.h.

193 {
194  return func(value1, value2);
195 }

◆ generate_random_real()

std::vector<T> arm_compute::test::generate_random_real ( unsigned int  num_values,
min,
max,
std::random_device::result_type  seed 
)
inline

Create a vector with a uniform distribution of floating point values across the specified range.

Parameters
[in]num_valuesThe number of values to be created.
[in]minThe minimum value in distribution (inclusive).
[in]maxThe maximum value in distribution (inclusive).
[in]seedThe random seed to be used.
Returns
A vector that contains the requested number of random floating point values

Definition at line 483 of file Utils.h.

484 {
485  std::vector<T> v(num_values);
486  std::mt19937 gen(seed);
487  std::uniform_real_distribution<T> dist(min, max);
488 
489  for(unsigned int i = 0; i < num_values; ++i)
490  {
491  v.at(i) = dist(gen);
492  }
493 
494  return v;
495 }

◆ get_channel_format()

Format arm_compute::test::get_channel_format ( Channel  channel)
inline

Return the format of a channel.

Parameters
[in]channelChannel type.
Returns
Format of the given channel.

Definition at line 164 of file Utils.h.

165 {
166  switch(channel)
167  {
168  case Channel::R:
169  case Channel::G:
170  case Channel::B:
171  return Format::U8;
172  default:
173  throw std::runtime_error("Unsupported channel");
174  }
175 }

References arm_compute::B, arm_compute::G, arm_compute::R, and arm_compute::U8.

◆ get_format_for_channel()

Format arm_compute::test::get_format_for_channel ( Channel  channel)
inline

Look up the format corresponding to a channel.

Parameters
[in]channelChannel type.
Returns
Format that contains the given channel.

Definition at line 145 of file Utils.h.

146 {
147  switch(channel)
148  {
149  case Channel::R:
150  case Channel::G:
151  case Channel::B:
152  return Format::RGB888;
153  default:
154  throw std::runtime_error("Unsupported channel");
155  }
156 }

References arm_compute::B, arm_compute::G, arm_compute::R, and arm_compute::RGB888.

Referenced by AssetsLibrary::fill(), and AssetsLibrary::get().

◆ get_typestring()

std::string arm_compute::test::get_typestring ( DataType  data_type)
inline

Obtain numpy type string from DataType.

Parameters
[in]data_typeData type.
Returns
numpy type string.

Definition at line 510 of file Utils.h.

511 {
512  // Check endianness
513  const unsigned int i = 1;
514  const char *c = reinterpret_cast<const char *>(&i);
515  std::string endianness;
516  if(*c == 1)
517  {
518  endianness = std::string("<");
519  }
520  else
521  {
522  endianness = std::string(">");
523  }
524  const std::string no_endianness("|");
525 
526  switch(data_type)
527  {
528  case DataType::U8:
529  return no_endianness + "u" + support::cpp11::to_string(sizeof(uint8_t));
530  case DataType::S8:
531  return no_endianness + "i" + support::cpp11::to_string(sizeof(int8_t));
532  case DataType::U16:
533  return endianness + "u" + support::cpp11::to_string(sizeof(uint16_t));
534  case DataType::S16:
535  return endianness + "i" + support::cpp11::to_string(sizeof(int16_t));
536  case DataType::U32:
537  return endianness + "u" + support::cpp11::to_string(sizeof(uint32_t));
538  case DataType::S32:
539  return endianness + "i" + support::cpp11::to_string(sizeof(int32_t));
540  case DataType::U64:
541  return endianness + "u" + support::cpp11::to_string(sizeof(uint64_t));
542  case DataType::S64:
543  return endianness + "i" + support::cpp11::to_string(sizeof(int64_t));
544  case DataType::F32:
545  return endianness + "f" + support::cpp11::to_string(sizeof(float));
546  case DataType::F64:
547  return endianness + "f" + support::cpp11::to_string(sizeof(double));
548  case DataType::SIZET:
549  return endianness + "u" + support::cpp11::to_string(sizeof(size_t));
550  default:
551  ARM_COMPUTE_ERROR("NOT SUPPORTED!");
552  }
553 }

References ARM_COMPUTE_ERROR, arm_compute::test::validation::data_type, arm_compute::F32, arm_compute::F64, arm_compute::S16, arm_compute::S32, arm_compute::S64, arm_compute::S8, arm_compute::SIZET, arm_compute::support::cpp11::to_string(), arm_compute::U16, arm_compute::U32, arm_compute::U64, and arm_compute::U8.

◆ index2coord()

Coordinates arm_compute::test::index2coord ( const TensorShape shape,
int  index 
)
inline

Convert a linear index into n-dimensional coordinates.

Parameters
[in]shapeShape of the n-dimensional tensor.
[in]indexLinear index specifying the i-th element.
Returns
n-dimensional coordinates.

Definition at line 359 of file Utils.h.

360 {
361  int num_elements = shape.total_size();
362 
363  ARM_COMPUTE_ERROR_ON_MSG(index < 0 || index >= num_elements, "Index has to be in [0, num_elements]");
364  ARM_COMPUTE_ERROR_ON_MSG(num_elements == 0, "Cannot create coordinate from empty shape");
365 
366  Coordinates coord{ 0 };
367 
368  for(int d = shape.num_dimensions() - 1; d >= 0; --d)
369  {
370  num_elements /= shape[d];
371  coord.set(d, index / num_elements);
372  index %= num_elements;
373  }
374 
375  return coord;
376 }

References ARM_COMPUTE_ERROR_ON_MSG, and arm_compute::test::validation::shape.

Referenced by arm_compute::test::validation::reference::erode(), AssetsLibrary::fill(), AssetsLibrary::fill_boxes(), AssetsLibrary::fill_with_generator(), arm_compute::test::validation::reference::non_maxima_suppression(), arm_compute::test::validation::reference::pad_layer(), arm_compute::test::validation::reference::permute(), arm_compute::test::validation::reference::reverse(), arm_compute::test::validation::reference::scale_core(), arm_compute::test::validation::reference::tile(), arm_compute::test::validation::reference::transpose(), arm_compute::test::validation::transpose(), arm_compute::test::validation::validate(), and arm_compute::test::validation::validate_wrap().

◆ is_in_valid_region()

bool arm_compute::test::is_in_valid_region ( const ValidRegion valid_region,
Coordinates  coord 
)
inline

Check if a coordinate is within a valid region.

Definition at line 406 of file Utils.h.

407 {
408  for(size_t d = 0; d < Coordinates::num_max_dimensions; ++d)
409  {
410  if(coord[d] < valid_region.start(d) || coord[d] >= valid_region.end(d))
411  {
412  return false;
413  }
414  }
415 
416  return true;
417 }

References ValidRegion::end(), Dimensions< int >::num_max_dimensions, ValidRegion::start(), and arm_compute::test::validation::valid_region.

Referenced by arm_compute::test::validation::reference::non_maxima_suppression(), arm_compute::test::validation::validate(), and arm_compute::test::validation::validate_wrap().

◆ join() [1/3]

std::string arm_compute::test::join ( T &&  first,
T &&  last,
const std::string &  separator 
)

Helper function to concatenate multiple values.

All values are converted to std::string using std::to_string before being joined.

Parameters
[in]firstIterator pointing to the first element to be concatenated.
[in]lastIterator pointing behind the last element to be concatenated.
[in]separatorString used to join the elements.
Returns
String containing all elements joined by separator.

Definition at line 136 of file Utils.h.

137 {
138  return join(std::forward<T>(first), std::forward<T>(last), separator, support::cpp11::to_string);
139 }

References join(), and arm_compute::support::cpp11::to_string().

◆ join() [2/3]

std::string arm_compute::test::join ( T &&  first,
T &&  last,
const std::string &  separator,
UnaryOp &&  op 
)

Helper function to concatenate multiple values.

All values are converted to std::string using the provided operation before being joined.

The signature of op has to be equivalent to std::string op(const T::value_type &val).

Parameters
[in]firstIterator pointing to the first element to be concatenated.
[in]lastIterator pointing behind the last element to be concatenated.
[in]separatorString used to join the elements.
[in]opConversion function.
Returns
String containing all elements joined by separator.

Definition at line 117 of file Utils.h.

118 {
119  return std::accumulate(std::next(first), last, op(*first), [&separator, &op](const std::string & base, const typename T::value_type & suffix)
120  {
121  return base + separator + op(suffix);
122  });
123 }

References arm_compute::test::validation::reference::accumulate().

◆ join() [3/3]

std::string arm_compute::test::join ( first,
last,
const std::string &  separator 
)

Helper function to concatenate multiple strings.

Parameters
[in]firstIterator pointing to the first element to be concatenated.
[in]lastIterator pointing behind the last element to be concatenated.
[in]separatorString used to join the elements.
Returns
String containing all elements joined by separator.

Definition at line 93 of file Utils.h.

94 {
95  return std::accumulate(std::next(first), last, *first, [&separator](const std::string & base, const std::string & suffix)
96  {
97  return base + separator + suffix;
98  });
99 }

References arm_compute::test::validation::reference::accumulate().

Referenced by join(), and JSONPrinter::print_measurements().

◆ operator<<()

std::ostream& arm_compute::test::operator<< ( std::ostream &  os,
const SimpleTensor< T > &  tensor 
)
inline

Definition at line 131 of file SimpleTensorPrinter.h.

132 {
133  os << prettify_tensor(tensor, IOFormatInfo{ IOFormatInfo::PrintRegion::NoPadding });
134  return os;
135 }

References IOFormatInfo::NoPadding, prettify_tensor(), and tensor.

◆ prettify_tensor()

std::string arm_compute::test::prettify_tensor ( const SimpleTensor< T > &  input,
const IOFormatInfo io_fmt = IOFormatInfoIOFormatInfo::PrintRegion::NoPadding } 
)
inline

Definition at line 41 of file SimpleTensorPrinter.h.

41  { IOFormatInfo::PrintRegion::NoPadding })
42 {
43  ARM_COMPUTE_ERROR_ON(input.data() == nullptr);
44 
45  RawTensor tensor(std::move(SimpleTensor<T>(input)));
46 
47  TensorInfo info(tensor.shape(), tensor.num_channels(), tensor.data_type());
48 
49  const DataType dt = info.data_type();
50  const size_t slices2D = info.tensor_shape().total_size_upper(2);
51  const Strides strides = info.strides_in_bytes();
52  const PaddingSize padding = info.padding();
53  const size_t num_channels = info.num_channels();
54 
55  std::ostringstream os;
56 
57  // Set precision
58  if(is_data_type_float(dt) && (io_fmt.precision_type != IOFormatInfo::PrecisionType::Default))
59  {
60  int precision = io_fmt.precision;
61  if(io_fmt.precision_type == IOFormatInfo::PrecisionType::Full)
62  {
63  precision = std::numeric_limits<float>().max_digits10;
64  }
65  os.precision(precision);
66  }
67 
68  // Define region to print
69  size_t print_width = 0;
70  size_t print_height = 0;
71  int start_offset = 0;
72  switch(io_fmt.print_region)
73  {
74  case IOFormatInfo::PrintRegion::NoPadding:
75  print_width = info.dimension(0);
76  print_height = info.dimension(1);
77  start_offset = info.offset_first_element_in_bytes();
78  break;
79  case IOFormatInfo::PrintRegion::ValidRegion:
80  print_width = info.valid_region().shape.x();
81  print_height = info.valid_region().shape.y();
82  start_offset = info.offset_element_in_bytes(Coordinates(info.valid_region().anchor.x(),
83  info.valid_region().anchor.y()));
84  break;
85  case IOFormatInfo::PrintRegion::Full:
86  print_width = padding.left + info.dimension(0) + padding.right;
87  print_height = padding.top + info.dimension(1) + padding.bottom;
88  start_offset = static_cast<int>(info.offset_first_element_in_bytes()) - padding.top * strides[1] - padding.left * strides[0];
89  break;
90  default:
91  break;
92  }
93 
94  print_width = print_width * num_channels;
95 
96  // Set pointer to start
97  const uint8_t *ptr = tensor.data() + start_offset;
98 
99  // Start printing
100  for(size_t i = 0; i < slices2D; ++i)
101  {
102  // Find max_width of elements in slice to align columns
103  int max_element_width = 0;
104  if(io_fmt.align_columns)
105  {
106  size_t offset = i * strides[2];
107  for(size_t h = 0; h < print_height; ++h)
108  {
109  max_element_width = std::max<int>(max_element_width, max_consecutive_elements_display_width(os, dt, ptr + offset, print_width));
110  offset += strides[1];
111  }
112  }
113 
114  // Print slice
115  {
116  size_t offset = i * strides[2];
117  for(size_t h = 0; h < print_height; ++h)
118  {
119  print_consecutive_elements(os, dt, ptr + offset, print_width, max_element_width, io_fmt.element_delim);
120  offset += strides[1];
121  os << io_fmt.row_delim;
122  }
123  os << io_fmt.row_delim;
124  }
125  }
126 
127  return os.str();
128 }

References IOFormatInfo::NoPadding.

Referenced by operator<<().

◆ round_half_even()

T arm_compute::test::round_half_even ( value,
epsilon = std::numeric_limits<T>::epsilon() 
)
inline

Round floating-point value with half value rounding to nearest even.

Parameters
[in]valuefloating-point value to be rounded.
[in]epsilonprecision.
Returns
Floating-point value of rounded value.

Definition at line 82 of file Utils.h.

83 {
84  T positive_value = std::abs(value);
85  T ipart = 0;
86  std::modf(positive_value, &ipart);
87  // If 'value' is exactly halfway between two integers
88  if(std::abs(positive_value - (ipart + 0.5f)) < epsilon)
89  {
90  // If 'ipart' is even then return 'ipart'
91  if(std::fmod(ipart, 2.f) < epsilon)
92  {
93  return support::cpp11::copysign(ipart, value);
94  }
95  // Else return the nearest even integer
96  return support::cpp11::copysign(std::ceil(ipart + 0.5f), value);
97  }
98  // Otherwise use the usual round to closest
99  return support::cpp11::copysign(support::cpp11::round(positive_value), value);
100 }

References arm_compute::support::cpp11::copysign(), arm_compute::quantization::epsilon, and arm_compute::support::cpp11::round().

◆ round_half_up()

T arm_compute::test::round_half_up ( value)
inline

Round floating-point value with half value rounding to positive infinity.

Parameters
[in]valuefloating-point value to be rounded.
Returns
Floating-point value of rounded value.

Definition at line 69 of file Utils.h.

70 {
71  return std::floor(value + 0.5f);
72 }

◆ saturate_cast()

T arm_compute::test::saturate_cast ( val)

Saturate a value of type T against the numeric limits of type U.

Parameters
[in]valValue to be saturated.
Returns
saturated value.

Definition at line 313 of file Utils.h.

314 {
315  if(val > static_cast<T>(std::numeric_limits<U>::max()))
316  {
317  val = static_cast<T>(std::numeric_limits<U>::max());
318  }
319  if(val < static_cast<T>(std::numeric_limits<U>::lowest()))
320  {
321  val = static_cast<T>(std::numeric_limits<U>::lowest());
322  }
323  return val;
324 }

References arm_compute::support::cpp11::lowest().

◆ set_tensor_dynamic()

void arm_compute::test::set_tensor_dynamic ( TensorType t)

Set the dimension states of the given tensor to dynamic.

Parameters
[in]tThe tensor to set to dynamic state

Definition at line 617 of file Utils.h.

618 {
619  t.info()->set_tensor_dims_state(construct_dynamic_dims_state());
620 }

References construct_dynamic_dims_state(), and tf_frozen_model_extractor::t.

◆ set_tensor_static()

void arm_compute::test::set_tensor_static ( TensorType t)

Set the dimension states of the given tensor to state.

Parameters
[in]tThe tensor to set to static state

Definition at line 628 of file Utils.h.

629 {
630  t.info()->set_tensor_dims_state(construct_static_dims_state());
631 }

References construct_static_dims_state(), and tf_frozen_model_extractor::t.

◆ shape_to_valid_region()

ValidRegion arm_compute::test::shape_to_valid_region ( const TensorShape a_shape,
bool  border_undefined = false,
BorderSize  border_size = BorderSize(0) 
)
inline

Create a valid region based on tensor shape, border mode and border size.

Parameters
[in]a_shapeShape used as size of the valid region.
[in]border_undefined(Optional) Boolean indicating if the border mode is undefined.
[in]border_size(Optional) Border size used to specify the region to exclude.
Returns
A valid region starting at (0, 0, ...) with size of shape if border_undefined is false; otherwise return A valid region starting at (border_size.left, border_size.top, ...) with reduced size of shape.

Definition at line 219 of file Utils.h.

220 {
221  ValidRegion valid_region{ Coordinates(), a_shape };
222 
223  Coordinates &anchor = valid_region.anchor;
224  TensorShape &shape = valid_region.shape;
225 
226  if(border_undefined)
227  {
228  ARM_COMPUTE_ERROR_ON(shape.num_dimensions() < 2);
229 
230  anchor.set(0, border_size.left);
231  anchor.set(1, border_size.top);
232 
233  const int valid_shape_x = std::max(0, static_cast<int>(shape.x()) - static_cast<int>(border_size.left) - static_cast<int>(border_size.right));
234  const int valid_shape_y = std::max(0, static_cast<int>(shape.y()) - static_cast<int>(border_size.top) - static_cast<int>(border_size.bottom));
235 
236  shape.set(0, valid_shape_x);
237  shape.set(1, valid_shape_y);
238  }
239 
240  return valid_region;
241 }

References ValidRegion::anchor, ARM_COMPUTE_ERROR_ON, Dimensions< T >::set(), arm_compute::test::validation::shape, ValidRegion::shape, and arm_compute::test::validation::valid_region.

Referenced by arm_compute::test::validation::reference::non_maxima_suppression(), arm_compute::test::validation::validate(), and arm_compute::test::validation::validate_wrap().

◆ sleep_in_seconds()

void arm_compute::test::sleep_in_seconds ( float  seconds)

Makes the calling thread to sleep for a specified number of seconds.

Parameters
[in]secondsAmount of seconds to sleep. Will return immediately if less or equal to zero.

Definition at line 38 of file Utils.cpp.

39 {
40  // Early return on non-positive input
41  if(seconds <= 0.f)
42  {
43  return;
44  }
45 
46 #ifndef NO_MULTI_THREADING
47  const int64_t us = static_cast<int64_t>(seconds * 1e6);
48  std::this_thread::sleep_for(std::chrono::microseconds(us));
49 #endif /* NO_MULTI_THREADING */
50 }

Referenced by Framework::run().

◆ store_value_with_data_type()

void arm_compute::test::store_value_with_data_type ( void *  ptr,
value,
DataType  data_type 
)

Write the value after casting the pointer according to data_type.

Warning
The type of the value must match the specified data type.
Parameters
[out]ptrPointer to memory where the value will be written.
[in]valueValue that will be written.
[in]data_typeData type that will be written.

Definition at line 252 of file Utils.h.

253 {
254  switch(data_type)
255  {
256  case DataType::U8:
257  case DataType::QASYMM8:
258  *reinterpret_cast<uint8_t *>(ptr) = value;
259  break;
260  case DataType::S8:
261  case DataType::QASYMM8_SIGNED:
262  case DataType::QSYMM8:
263  case DataType::QSYMM8_PER_CHANNEL:
264  *reinterpret_cast<int8_t *>(ptr) = value;
265  break;
266  case DataType::U16:
267  case DataType::QASYMM16:
268  *reinterpret_cast<uint16_t *>(ptr) = value;
269  break;
270  case DataType::S16:
271  case DataType::QSYMM16:
272  *reinterpret_cast<int16_t *>(ptr) = value;
273  break;
274  case DataType::U32:
275  *reinterpret_cast<uint32_t *>(ptr) = value;
276  break;
277  case DataType::S32:
278  *reinterpret_cast<int32_t *>(ptr) = value;
279  break;
280  case DataType::U64:
281  *reinterpret_cast<uint64_t *>(ptr) = value;
282  break;
283  case DataType::S64:
284  *reinterpret_cast<int64_t *>(ptr) = value;
285  break;
286  case DataType::BFLOAT16:
287  *reinterpret_cast<bfloat16 *>(ptr) = bfloat16(value);
288  break;
289  case DataType::F16:
290  *reinterpret_cast<half *>(ptr) = value;
291  break;
292  case DataType::F32:
293  *reinterpret_cast<float *>(ptr) = value;
294  break;
295  case DataType::F64:
296  *reinterpret_cast<double *>(ptr) = value;
297  break;
298  case DataType::SIZET:
299  *reinterpret_cast<size_t *>(ptr) = value;
300  break;
301  default:
302  ARM_COMPUTE_ERROR("NOT SUPPORTED!");
303  }
304 }

References ARM_COMPUTE_ERROR, arm_compute::BFLOAT16, arm_compute::test::validation::data_type, arm_compute::F16, arm_compute::F32, arm_compute::F64, arm_compute::QASYMM16, arm_compute::QASYMM8, arm_compute::QASYMM8_SIGNED, arm_compute::QSYMM16, arm_compute::QSYMM8, arm_compute::QSYMM8_PER_CHANNEL, arm_compute::S16, arm_compute::S32, arm_compute::S64, arm_compute::S8, arm_compute::SIZET, arm_compute::U16, arm_compute::U32, arm_compute::U64, and arm_compute::U8.

Referenced by AssetsLibrary::fill(), AssetsLibrary::fill_boxes(), and AssetsLibrary::fill_with_generator().

◆ swap()

void arm_compute::test::swap ( SimpleTensor< U > &  tensor1,
SimpleTensor< U > &  tensor2 
)
Parameters
[in,out]tensor1Tensor to be swapped.
[in,out]tensor2Tensor to be swapped.

Definition at line 460 of file SimpleTensor.h.

461 {
462  // Use unqualified call to swap to enable ADL. But make std::swap available
463  // as backup.
464  using std::swap;
465  swap(tensor1._shape, tensor2._shape);
466  swap(tensor1._format, tensor2._format);
467  swap(tensor1._data_type, tensor2._data_type);
468  swap(tensor1._num_channels, tensor2._num_channels);
469  swap(tensor1._quantization_info, tensor2._quantization_info);
470  swap(tensor1._buffer, tensor2._buffer);
471 }

Referenced by SimpleTensor< uint8_t >::operator=().

◆ sync_if_necessary()

void arm_compute::test::sync_if_necessary ( )
inline

Sync if necessary.

Definition at line 558 of file Utils.h.

559 {
560 #ifdef ARM_COMPUTE_CL
561  if(opencl_is_available() && std::is_same<typename std::decay<TensorType>::type, arm_compute::CLTensor>::value)
562  {
563  CLScheduler::get().sync();
564  }
565 #endif /* ARM_COMPUTE_CL */
566 }

References CLScheduler::get(), arm_compute::opencl_is_available(), CLScheduler::sync(), and type.

◆ sync_tensor_if_necessary()

void arm_compute::test::sync_tensor_if_necessary ( TensorType tensor)
inline

Sync tensor if necessary.

Note
: If the destination tensor not being used on OpenGL ES, GPU will optimize out the operation.
Parameters
[in]tensorTensor to be sync.

Definition at line 575 of file Utils.h.

576 {
578 }

References ARM_COMPUTE_UNUSED, and tensor.

◆ to_string()

std::string arm_compute::test::to_string ( const SimpleTensor< T > &  tensor)
inline

Definition at line 138 of file SimpleTensorPrinter.h.

139 {
140  std::stringstream ss;
141  ss << tensor;
142  return ss.str();
143 }

References arm_compute::test::validation::ss(), and tensor.

Referenced by main().

◆ tolower()

std::string arm_compute::test::tolower ( std::string  string)
inline

Convert string to lower case.

Parameters
[in]stringTo be converted string.
Returns
Lower case string.

Definition at line 147 of file Utils.h.

148 {
149  std::transform(string.begin(), string.end(), string.begin(), [](unsigned char c)
150  {
151  return std::tolower(c);
152  });
153  return string;
154 }

References arm_compute::mlgo::parser::end().

Referenced by arm_compute::test::framework::dataset_mode_from_name(), arm_compute::test::framework::instrument_type_from_name(), arm_compute::test::framework::log_format_from_name(), and arm_compute::test::framework::log_level_from_name().

Variable Documentation

◆ fixed_library

std::unique_ptr< AssetsLibrary > fixed_library

Definition at line 80 of file main.cpp.

Referenced by main().

◆ library

◆ parameters

GemmTuner.args
args
Definition: GemmTuner.py:679
arm_compute::opencl_is_available
bool opencl_is_available()
Check if OpenCL is available.
Definition: OpenCL.cpp:208
arm_compute::experimental::dynamic_fusion::Conv2dAttributes::pad
Conv2dAttributes & pad(const Padding2D &pad)
Set padding.
Definition: Conv2dAttributes.cpp:33
arm_compute::test::construct_dims_state
ITensorInfo::TensorDimsState construct_dims_state(int32_t value)
Construct and return object for dimensions' state filled with the given value.
Definition: Utils.h:586
type
decltype(strategy::transforms) typedef type
Definition: gemm_interleaved.hpp:261
arm_compute::test::construct_dynamic_dims_state
ITensorInfo::TensorDimsState construct_dynamic_dims_state()
Construct and return object for dimensions' state filled with the value for dynamic state.
Definition: Utils.h:597
arm_compute::support::cpp11::lowest
T lowest()
Definition: ToolchainSupport.h:279
ARM_COMPUTE_ERROR
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:354
arm_compute::CLTensor
Basic implementation of the OpenCL tensor interface.
Definition: CLTensor.h:41
arm_compute::test::validation::utils::fill
void fill(U &&tensor, int seed, AssetsLibrary *library)
Definition: Utils.h:56
acl::DataType
DataType
Definition: Acl.hpp:482
arm_compute::cpu::data_layout
constexpr auto data_layout
Definition: impl.h:36
arm_compute::test::construct_static_dims_state
ITensorInfo::TensorDimsState construct_static_dims_state()
Construct and return object for dimensions' state filled with the value for non-dynamic state.
Definition: Utils.h:606
arm_compute::test::validation::valid_region
const ValidRegion valid_region
Definition: Scale.cpp:214
arm_compute::experimental::dynamic_fusion::Conv2dAttributes
Attributes are backend-agnostic parameters (in addition to the input/output tensors) of an operator.
Definition: Conv2dAttributes.h:42
arm_compute::experimental::dynamic_fusion::Conv2dAttributes::stride
Conv2dAttributes & stride(const Size2D &stride)
Set stride.
Definition: Conv2dAttributes.cpp:42
arm_compute::half
half_float::half half
16-bit floating point type
Definition: CoreTypes.h:36
arm_compute::test::validation::shape
shape
Definition: DFT.cpp:115
ARM_COMPUTE_ERROR_ON
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
arm_compute::test::validation::ss
std::stringstream ss(mlgo_str)
ARM_COMPUTE_ERROR_ON_MSG
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
Definition: Error.h:456
arm_compute::round
int round(float x, RoundingPolicy rounding_policy)
Return a rounded value of x.
Definition: Rounding.cpp:36
arm_compute::test::prettify_tensor
std::string prettify_tensor(const SimpleTensor< T > &input, const IOFormatInfo &io_fmt=IOFormatInfo{ IOFormatInfo::PrintRegion::NoPadding })
Definition: SimpleTensorPrinter.h:41
arm_compute::test::join
std::string join(T &&first, T &&last, const std::string &separator)
Helper function to concatenate multiple values.
Definition: Utils.h:136
arm_gemm::bfloat16
arm_compute::bfloat16 bfloat16
Definition: bfloat.hpp:30
arm_compute::ValidRegion::start
int start(unsigned int d) const
Return the start of the valid region for the given dimension d.
Definition: Types.h:187
offset
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
Definition: helpers.h:1128
arm_compute::test::tolower
std::string tolower(std::string string)
Convert string to lower case.
Definition: Utils.h:147
arm_compute::test::validation::reference::accumulate
SimpleTensor< T2 > accumulate(const SimpleTensor< T1 > &src, DataType output_data_type)
Definition: Accumulate.cpp:38
ARM_COMPUTE_UNUSED
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Definition: Error.h:151
dt
DataType dt
Definition: NEBatchNormalizationLayerKernel.cpp:50
tensor
CLTensor * tensor
Pointer to the auxiliary tensor.
Definition: ClWorkloadRuntime.cpp:67
arm_compute::test::validation::data_type
data_type
Definition: Cast.cpp:222
arm_compute::test::library
std::unique_ptr< AssetsLibrary > library
Definition: main.cpp:77
arm_compute::test::framework::apply_impl
void apply_impl(O *obj, F &&func, const std::tuple< As... > &args, detail::sequence< S... >)
Definition: Utils.h:72
arm_compute::experimental::dynamic_fusion::Conv2dAttributes::dilation
Conv2dAttributes & dilation(const Size2D &dilation)
Set dilation.
Definition: Conv2dAttributes.cpp:51
arm_compute::PaddingSize
BorderSize PaddingSize
Container for 2D padding size.
Definition: Types.h:346
arm_compute::ValidRegion::shape
TensorShape shape
Shape of the valid region.
Definition: Types.h:223
arm_compute::test::foldl
I foldl(F &&func, I &&initial, T &&value, Vs &&... values)
Fold left.
Definition: Utils.h:205
arm_compute::to_string
std::string to_string(const ClComponentElementwiseBinary::Attributes::ElementwiseOp &op)
Formatted output of the arm_compute::experimental::dynamic_fusion::ClComponentElementwiseBinary::Attr...
Definition: ElementwiseBinary.h:68
arm_compute::support::cpp11::copysign
T copysign(T x, T y)
Composes a floating point value with the magnitude of x and the sign of y.
Definition: ToolchainSupport.h:232
arm_compute::is_data_type_float
bool is_data_type_float(DataType dt)
Check if a given data type is of floating point type.
Definition: DataTypeUtils.h:304
arm_compute::ValidRegion::end
int end(unsigned int d) const
Return the end of the valid region for the given dimension d.
Definition: Types.h:193
arm_compute::mlgo::parser::end
void end(TokenStream &in, bool &valid)
Definition: MLGOParser.cpp:283
arm_compute::test::swap
void swap(SimpleTensor< U > &tensor1, SimpleTensor< U > &tensor2)
Definition: SimpleTensor.h:460
arm_compute::test::validation::info
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
tf_frozen_model_extractor.t
t
Definition: tf_frozen_model_extractor.py:49
arm_compute::test::validation::input
auto input
Definition: LSTMLayerQuantized.cpp:486
arm_compute::ValidRegion::anchor
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:222
arm_compute::quantization::epsilon
constexpr float epsilon
Definition: AsymmHelpers.cpp:41