12 #include <Eigen/CXX11/Tensor>
17 template <
int DataLayout>
46 template <
int DataLayout>
58 result = input.convolve(kernel, dims);
61 input(1,0)*kernel(1,0) + input(1,1)*kernel(1,1));
63 input(1,1)*kernel(1,0) + input(1,2)*kernel(1,1));
65 input(2,0)*kernel(1,0) + input(2,1)*kernel(1,1));
67 input(2,1)*kernel(1,0) + input(2,2)*kernel(1,1));
70 template <
int DataLayout>
87 padding[0] = std::make_pair(0, 0);
89 valid = input.pad(padding).convolve(kernel, dims);
95 padding[0] = std::make_pair(1, 1);
97 same = input.pad(padding).convolve(kernel, dims);
105 padding[0] = std::make_pair(2, 2);
107 full = input.pad(padding).convolve(kernel, dims);
116 template <
int DataLayout>
131 result = input.
stride(stride_of_3).convolve(kernel, dims).stride(stride_of_2);
135 input(6)*kernel(2)));
137 input(12)*kernel(2)));