12 #include <Eigen/CXX11/Tensor> 16 template <
int DataLayout>
28 no_broadcast = tensor.broadcast(broadcasts);
35 for (
int i = 0;
i < 2; ++
i) {
36 for (
int j = 0;
j < 3; ++
j) {
37 for (
int k = 0; k < 5; ++k) {
38 for (
int l = 0;
l < 7; ++
l) {
50 broadcast = tensor.broadcast(broadcasts);
57 for (
int i = 0;
i < 4; ++
i) {
58 for (
int j = 0;
j < 9; ++
j) {
59 for (
int k = 0; k < 5; ++k) {
60 for (
int l = 0;
l < 28; ++
l) {
69 template <
int DataLayout>
80 broadcast = tensor.broadcast(broadcasts);
86 for (
int i = 0;
i < 16; ++
i) {
87 for (
int j = 0;
j < 9; ++
j) {
88 for (
int k = 0; k < 20; ++k) {
96 broadcast = tensor.broadcast(broadcasts);
102 for (
int i = 0;
i < 22; ++
i) {
103 for (
int j = 0;
j < 9; ++
j) {
104 for (
int k = 0; k < 20; ++k) {
112 template <
int DataLayout>
118 #if EIGEN_HAS_CONSTEXPR 119 Eigen::IndexList<Eigen::type2index<2>, Eigen::type2index<3>, Eigen::type2index<4>> broadcasts;
128 broadcast = tensor.broadcast(broadcasts);
134 for (
int i = 0;
i < 16; ++
i) {
135 for (
int j = 0;
j < 9; ++
j) {
136 for (
int k = 0; k < 20; ++k) {
144 broadcast = tensor.broadcast(broadcasts);
150 for (
int i = 0;
i < 22; ++
i) {
151 for (
int j = 0;
j < 9; ++
j) {
152 for (
int k = 0; k < 20; ++k) {
160 template <
int DataLayout>
168 t2 = t2.constant(20.0
f);
171 for (
int i = 0;
i < 10; ++
i) {
177 for (
int i = 0;
i < 10; ++
i) {
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index dimension(std::size_t n) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar * data()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor< Scalar_, NumIndices_, Options_, IndexType_ > & setRandom()
void test_cxx11_tensor_broadcasting()
static void test_simple_broadcasting()
static void test_vectorized_broadcasting()
#define VERIFY_IS_APPROX(a, b)
static const Line3 l(Rot3(), 1, 1)
#define VERIFY_IS_EQUAL(a, b)
A tensor expression mapping an existing array of data.
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
The fixed sized version of the tensor class.
EIGEN_DEVICE_FUNC void resize(const array< Index, NumIndices > &dimensions)
#define CALL_SUBTEST(FUNC)
static void test_static_broadcasting()
static void test_fixed_size_broadcasting()
broadcast_trivial broadcast(const std::array< buffer_info, N > &buffers, ssize_t &ndim, std::vector< ssize_t > &shape)