12 #include <Eigen/CXX11/Tensor> 17 Tensor<float, 2> ftensor(20,30);
18 ftensor = ftensor.random() * 100.f;
20 Tensor<float, 2> result = ftensor.round();
22 for (
int i = 0; i < 20; ++i) {
23 for (
int j = 0; j < 30; ++j) {
31 Tensor<float, 2> ftensor(20,30);
32 ftensor = ftensor.random() * 100.f;
34 Tensor<float, 2> result = ftensor.floor();
36 for (
int i = 0; i < 20; ++i) {
37 for (
int j = 0; j < 30; ++j) {
45 Tensor<float, 2> ftensor(20,30);
46 ftensor = ftensor.random() * 100.f;
48 Tensor<float, 2> result = ftensor.ceil();
50 for (
int i = 0; i < 20; ++i) {
51 for (
int j = 0; j < 30; ++j) {
52 VERIFY_IS_EQUAL(result(i,j),
numext::ceil(ftensor(i,j)));
EIGEN_DEVICE_FUNC const RoundReturnType round() const
EIGEN_DEVICE_FUNC const CeilReturnType ceil() const
static void test_float_flooring()
static void test_float_rounding()
void test_cxx11_tensor_roundings()
EIGEN_DEVICE_FUNC const FloorReturnType floor() const
static void test_float_ceiling()