12 #include <Eigen/CXX11/Tensor> 16 template<
int DataLayout>
23 paddings[0] = std::make_pair(0, 0);
24 paddings[1] = std::make_pair(2, 1);
25 paddings[2] = std::make_pair(3, 4);
26 paddings[3] = std::make_pair(0, 0);
29 padded = tensor.pad(paddings);
36 for (
int i = 0;
i < 2; ++
i) {
37 for (
int j = 0;
j < 6; ++
j) {
38 for (
int k = 0; k < 12; ++k) {
39 for (
int l = 0;
l < 7; ++
l) {
40 if (
j >= 2 && j < 5 && k >= 3 && k < 8) {
51 template<
int DataLayout>
58 paddings[0] = std::make_pair(0, 0);
59 paddings[1] = std::make_pair(2, 1);
60 paddings[2] = std::make_pair(3, 4);
61 paddings[3] = std::make_pair(0, 0);
68 result = tensor.pad(paddings).
reshape(reshape_dims);
70 for (
int i = 0;
i < 2; ++
i) {
71 for (
int j = 0;
j < 6; ++
j) {
72 for (
int k = 0; k < 12; ++k) {
73 for (
int l = 0;
l < 7; ++
l) {
74 const float result_value = DataLayout ==
ColMajor ?
76 if (
j >= 2 && j < 5 && k >= 3 && k < 8) {
static void test_padded_expr()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index dimension(std::size_t n) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor< Scalar_, NumIndices_, Options_, IndexType_ > & setRandom()
static const Line3 l(Rot3(), 1, 1)
#define VERIFY_IS_EQUAL(a, b)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorReshapingOp< const NewDimensions, const Tensor< Scalar_, NumIndices_, Options_, IndexType_ > > reshape(const NewDimensions &newDimensions) const
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
static void test_simple_padding()
#define CALL_SUBTEST(FUNC)
void test_cxx11_tensor_padding()