33 using namespace arm_compute;
34 using namespace arm_compute::test;
35 using namespace arm_compute::test::validation;
40 DATA_TEST_CASE(RoundHalfUp, framework::
DatasetMode::ALL,
zip(framework::dataset::
make("FloatIn", { 1.f, 1.2f, 1.5f, 2.5f, 2.9f, -3.f, -3.5f, -3.8f, -4.3f, -4.5f }),
41 framework::dataset::make(
"FloatOut", { 1.f, 1.f, 2.f, 3.f, 3.f, -3.f, -3.f, -4.f, -4.f, -4.f })),
47 DATA_TEST_CASE(RoundHalfEven,
framework::DatasetMode::ALL,
zip(
framework::dataset::make(
"FloatIn", { 1.f, 1.2f, 1.5f, 2.5f, 2.9f, -3.f, -3.5f, -3.8f, -4.3f, -4.5f }),
48 framework::dataset::make(
"FloatOut", { 1.f, 1.f, 2.f, 2.f, 3.f, -3.f, -4.f, -4.f, -4.f, -4.f })),
54 DATA_TEST_CASE(Index2Coord,
framework::DatasetMode::ALL,
zip(
zip(
framework::dataset::make(
"Shape", {
TensorShape{ 1
U },
TensorShape{ 2
U },
TensorShape{ 2
U, 3
U } }),
framework::dataset::make(
"Index", { 0, 1, 2 })),
56 shape, index, ref_coordinate)
66 shape, coordinate, ref_index)
bool compare_dimensions(const Dimensions< T > &dimensions1, const Dimensions< T > &dimensions2)
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
int coord2index(const TensorShape &shape, const Coordinates &coord)
Linearise the given coordinate.
T round_half_even(T value, T epsilon=std::numeric_limits< T >::epsilon())
Round floating-point value with half value rounding to nearest even.
DatasetMode
Possible dataset modes.
ARM_COMPUTE_EXPECT(shape.num_dimensions()==dimension+1, framework::LogLevel::ERRORS)
Coordinates index2coord(const TensorShape &shape, int index)
Convert a linear index into n-dimensional coordinates.
TEST_SUITE_END() DATA_TEST_CASE(Configuration
#define TEST_SUITE(SUITE_NAME)
T round_half_up(T value)
Round floating-point value with half value rounding to positive infinity.
DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), CNNDataTypes), framework::dataset::make("InPlace",{false, true})), shape, data_type, in_place)
ZipDataset< T, U > zip(T &&dataset1, U &&dataset2)
Helper function to create a ZipDataset.