| 54 | template <typename Device, typename Input, typename Filter, typename Output, |
| 55 | typename OutputKernel> |
| 56 | void SpatialConvolutionFunc(const Device& d, Output output, Input input, |
| 57 | Filter filter, int row_stride, int col_stride, |
| 58 | int row_dilation, int col_dilation, |
| 59 | const Eigen::PaddingType& padding, |
| 60 | const OutputKernel& output_kernel, |
| 61 | int padding_top = 0, int padding_bottom = 0, |
| 62 | int padding_left = 0, int padding_right = 0) { |
| 63 | // Need to swap row/col, padding_top/padding_left, and |
| 64 | // padding_bottom/padding_right when calling Eigen. Eigen expects the tensor |
| 65 | // in NWHC format, but the tensor given is in NHWC. |
| 66 | output.device(d) = Eigen::SpatialConvolution( |
| 67 | input, filter, col_stride, row_stride, padding, col_dilation, |
| 68 | row_dilation, output_kernel, padding_left, padding_right, padding_top, |
| 69 | padding_bottom); |
| 70 | } |
| 71 | |
| 72 | template <typename Device, typename T, |
| 73 | typename OutputKernel = const Eigen::NoOpOutputKernel> |
no test coverage detected