10#ifndef EIGEN_CXX11_TENSOR_TENSOR_IMAGE_PATCH_H
11#define EIGEN_CXX11_TENSOR_TENSOR_IMAGE_PATCH_H
31template<DenseIndex Rows, DenseIndex Cols,
typename XprType>
32struct traits<TensorImagePatchOp<Rows, Cols, XprType> > :
public traits<XprType>
34 typedef typename internal::remove_const<typename XprType::Scalar>::type Scalar;
35 typedef traits<XprType> XprTraits;
36 typedef typename XprTraits::StorageKind StorageKind;
37 typedef typename XprTraits::Index
Index;
38 typedef typename XprType::Nested Nested;
39 typedef typename remove_reference<Nested>::type _Nested;
40 static const int NumDimensions = XprTraits::NumDimensions + 1;
41 static const int Layout = XprTraits::Layout;
42 typedef typename XprTraits::PointerType PointerType;
45template<DenseIndex Rows, DenseIndex Cols,
typename XprType>
46struct eval<TensorImagePatchOp<Rows, Cols, XprType>,
Eigen::Dense>
48 typedef const TensorImagePatchOp<Rows, Cols, XprType>& type;
51template<DenseIndex Rows, DenseIndex Cols,
typename XprType>
52struct nested<TensorImagePatchOp<Rows, Cols, XprType>, 1, typename eval<TensorImagePatchOp<Rows, Cols, XprType> >::type>
54 typedef TensorImagePatchOp<Rows, Cols, XprType> type;
57template <
typename Self,
bool Vectorizable>
58struct ImagePatchCopyOp {
59 typedef typename Self::Index
Index;
60 typedef typename Self::Scalar Scalar;
61 typedef typename Self::Impl Impl;
62 static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void Run(
63 const Self& self,
const Index num_coeff_to_copy,
const Index dst_index,
64 Scalar* dst_data,
const Index src_index) {
65 const Impl& impl = self.impl();
66 for (Index i = 0; i < num_coeff_to_copy; ++i) {
67 dst_data[dst_index + i] = impl.coeff(src_index + i);
72template <
typename Self>
73struct ImagePatchCopyOp<Self, true> {
74 typedef typename Self::Index
Index;
75 typedef typename Self::Scalar Scalar;
76 typedef typename Self::Impl Impl;
77 typedef typename packet_traits<Scalar>::type Packet;
78 static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void Run(
79 const Self& self,
const Index num_coeff_to_copy,
const Index dst_index,
80 Scalar* dst_data,
const Index src_index) {
81 const Impl& impl = self.impl();
82 const Index packet_size = internal::unpacket_traits<Packet>::size;
83 const Index vectorized_size =
84 (num_coeff_to_copy / packet_size) * packet_size;
85 for (Index i = 0; i < vectorized_size; i += packet_size) {
86 Packet p = impl.template packet<Unaligned>(src_index + i);
87 internal::pstoret<Scalar, Packet, Unaligned>(dst_data + dst_index + i, p);
89 for (Index i = vectorized_size; i < num_coeff_to_copy; ++i) {
90 dst_data[dst_index + i] = impl.coeff(src_index + i);
95template <
typename Self>
96struct ImagePatchPaddingOp {
97 typedef typename Self::Index
Index;
98 typedef typename Self::Scalar Scalar;
99 typedef typename packet_traits<Scalar>::type Packet;
100 static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void Run(
101 const Index num_coeff_to_pad,
const Scalar padding_value,
102 const Index dst_index, Scalar* dst_data) {
103 const Index packet_size = internal::unpacket_traits<Packet>::size;
104 const Packet padded_packet = internal::pset1<Packet>(padding_value);
105 const Index vectorized_size =
106 (num_coeff_to_pad / packet_size) * packet_size;
107 for (Index i = 0; i < vectorized_size; i += packet_size) {
108 internal::pstoret<Scalar, Packet, Unaligned>(dst_data + dst_index + i,
111 for (Index i = vectorized_size; i < num_coeff_to_pad; ++i) {
112 dst_data[dst_index + i] = padding_value;
119template<DenseIndex Rows, DenseIndex Cols,
typename XprType>
120class TensorImagePatchOp :
public TensorBase<TensorImagePatchOp<Rows, Cols, XprType>, ReadOnlyAccessors>
123 typedef typename Eigen::internal::traits<TensorImagePatchOp>::Scalar Scalar;
125 typedef typename XprType::CoeffReturnType CoeffReturnType;
126 typedef typename Eigen::internal::nested<TensorImagePatchOp>::type Nested;
127 typedef typename Eigen::internal::traits<TensorImagePatchOp>::StorageKind StorageKind;
128 typedef typename Eigen::internal::traits<TensorImagePatchOp>::Index
Index;
130 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorImagePatchOp(
const XprType& expr, DenseIndex patch_rows, DenseIndex patch_cols,
131 DenseIndex row_strides, DenseIndex col_strides,
132 DenseIndex in_row_strides, DenseIndex in_col_strides,
133 DenseIndex row_inflate_strides, DenseIndex col_inflate_strides,
134 PaddingType padding_type, Scalar padding_value)
135 : m_xpr(expr), m_patch_rows(patch_rows), m_patch_cols(patch_cols),
136 m_row_strides(row_strides), m_col_strides(col_strides),
137 m_in_row_strides(in_row_strides), m_in_col_strides(in_col_strides),
138 m_row_inflate_strides(row_inflate_strides), m_col_inflate_strides(col_inflate_strides),
139 m_padding_explicit(false), m_padding_top(0), m_padding_bottom(0), m_padding_left(0), m_padding_right(0),
140 m_padding_type(padding_type), m_padding_value(padding_value) {}
142 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorImagePatchOp(
const XprType& expr, DenseIndex patch_rows, DenseIndex patch_cols,
143 DenseIndex row_strides, DenseIndex col_strides,
144 DenseIndex in_row_strides, DenseIndex in_col_strides,
145 DenseIndex row_inflate_strides, DenseIndex col_inflate_strides,
146 DenseIndex padding_top, DenseIndex padding_bottom,
147 DenseIndex padding_left, DenseIndex padding_right,
148 Scalar padding_value)
149 : m_xpr(expr), m_patch_rows(patch_rows), m_patch_cols(patch_cols),
150 m_row_strides(row_strides), m_col_strides(col_strides),
151 m_in_row_strides(in_row_strides), m_in_col_strides(in_col_strides),
152 m_row_inflate_strides(row_inflate_strides), m_col_inflate_strides(col_inflate_strides),
153 m_padding_explicit(true), m_padding_top(padding_top), m_padding_bottom(padding_bottom),
154 m_padding_left(padding_left), m_padding_right(padding_right),
155 m_padding_type(PADDING_VALID), m_padding_value(padding_value) {}
159 DenseIndex patch_rows()
const {
return m_patch_rows; }
161 DenseIndex patch_cols()
const {
return m_patch_cols; }
163 DenseIndex row_strides()
const {
return m_row_strides; }
165 DenseIndex col_strides()
const {
return m_col_strides; }
167 DenseIndex in_row_strides()
const {
return m_in_row_strides; }
169 DenseIndex in_col_strides()
const {
return m_in_col_strides; }
171 DenseIndex row_inflate_strides()
const {
return m_row_inflate_strides; }
173 DenseIndex col_inflate_strides()
const {
return m_col_inflate_strides; }
175 bool padding_explicit()
const {
return m_padding_explicit; }
177 DenseIndex padding_top()
const {
return m_padding_top; }
179 DenseIndex padding_bottom()
const {
return m_padding_bottom; }
181 DenseIndex padding_left()
const {
return m_padding_left; }
183 DenseIndex padding_right()
const {
return m_padding_right; }
185 PaddingType padding_type()
const {
return m_padding_type; }
187 Scalar padding_value()
const {
return m_padding_value; }
190 const typename internal::remove_all<typename XprType::Nested>::type&
191 expression()
const {
return m_xpr; }
194 typename XprType::Nested m_xpr;
195 const DenseIndex m_patch_rows;
196 const DenseIndex m_patch_cols;
197 const DenseIndex m_row_strides;
198 const DenseIndex m_col_strides;
199 const DenseIndex m_in_row_strides;
200 const DenseIndex m_in_col_strides;
201 const DenseIndex m_row_inflate_strides;
202 const DenseIndex m_col_inflate_strides;
203 const bool m_padding_explicit;
204 const DenseIndex m_padding_top;
205 const DenseIndex m_padding_bottom;
206 const DenseIndex m_padding_left;
207 const DenseIndex m_padding_right;
208 const PaddingType m_padding_type;
209 const Scalar m_padding_value;
213template<DenseIndex Rows, DenseIndex Cols,
typename ArgType,
typename Device>
214struct TensorEvaluator<const TensorImagePatchOp<Rows, Cols, ArgType>, Device>
216 typedef TensorImagePatchOp<Rows, Cols, ArgType> XprType;
217 typedef typename XprType::Index
Index;
218 static const int NumInputDims = internal::array_size<typename TensorEvaluator<ArgType, Device>::Dimensions>::value;
219 static const int NumDims = NumInputDims + 1;
220 typedef DSizes<Index, NumDims> Dimensions;
221 typedef typename internal::remove_const<typename XprType::Scalar>::type Scalar;
222 typedef TensorEvaluator<const TensorImagePatchOp<Rows, Cols, ArgType>,
224 typedef TensorEvaluator<ArgType, Device> Impl;
225 typedef typename XprType::CoeffReturnType CoeffReturnType;
226 typedef typename PacketType<CoeffReturnType, Device>::type PacketReturnType;
227 static const int PacketSize = PacketType<CoeffReturnType, Device>::size;
228 typedef StorageMemory<CoeffReturnType, Device> Storage;
229 typedef typename Storage::Type EvaluatorPointerType;
233 PacketAccess = TensorEvaluator<ArgType, Device>::PacketAccess,
235 PreferBlockAccess =
true,
236 Layout = TensorEvaluator<ArgType, Device>::Layout,
242 typedef internal::TensorBlockNotImplemented TensorBlock;
245 EIGEN_STRONG_INLINE TensorEvaluator(
const XprType& op,
const Device& device)
246 : m_device(device), m_impl(op.expression(), device)
248 EIGEN_STATIC_ASSERT((NumDims >= 4), YOU_MADE_A_PROGRAMMING_MISTAKE);
250 m_paddingValue = op.padding_value();
252 const typename TensorEvaluator<ArgType, Device>::Dimensions& input_dims = m_impl.dimensions();
255 if (
static_cast<int>(Layout) ==
static_cast<int>(
ColMajor)) {
256 m_inputDepth = input_dims[0];
257 m_inputRows = input_dims[1];
258 m_inputCols = input_dims[2];
260 m_inputDepth = input_dims[NumInputDims-1];
261 m_inputRows = input_dims[NumInputDims-2];
262 m_inputCols = input_dims[NumInputDims-3];
265 m_row_strides = op.row_strides();
266 m_col_strides = op.col_strides();
269 m_in_row_strides = op.in_row_strides();
270 m_in_col_strides = op.in_col_strides();
271 m_row_inflate_strides = op.row_inflate_strides();
272 m_col_inflate_strides = op.col_inflate_strides();
286 m_input_rows_eff = (m_inputRows - 1) * m_row_inflate_strides + 1;
287 m_input_cols_eff = (m_inputCols - 1) * m_col_inflate_strides + 1;
288 m_patch_rows_eff = op.patch_rows() + (op.patch_rows() - 1) * (m_in_row_strides - 1);
289 m_patch_cols_eff = op.patch_cols() + (op.patch_cols() - 1) * (m_in_col_strides - 1);
291 if (op.padding_explicit()) {
292 m_outputRows = numext::ceil((m_input_rows_eff + op.padding_top() + op.padding_bottom() - m_patch_rows_eff + 1.f) /
static_cast<float>(m_row_strides));
293 m_outputCols = numext::ceil((m_input_cols_eff + op.padding_left() + op.padding_right() - m_patch_cols_eff + 1.f) /
static_cast<float>(m_col_strides));
294 m_rowPaddingTop = op.padding_top();
295 m_colPaddingLeft = op.padding_left();
298 switch (op.padding_type()) {
300 m_outputRows = numext::ceil((m_input_rows_eff - m_patch_rows_eff + 1.f) /
static_cast<float>(m_row_strides));
301 m_outputCols = numext::ceil((m_input_cols_eff - m_patch_cols_eff + 1.f) /
static_cast<float>(m_col_strides));
303 m_rowPaddingTop = numext::maxi<Index>(0, ((m_outputRows - 1) * m_row_strides + m_patch_rows_eff - m_input_rows_eff) / 2);
304 m_colPaddingLeft = numext::maxi<Index>(0, ((m_outputCols - 1) * m_col_strides + m_patch_cols_eff - m_input_cols_eff) / 2);
307 m_outputRows = numext::ceil(m_input_rows_eff /
static_cast<float>(m_row_strides));
308 m_outputCols = numext::ceil(m_input_cols_eff /
static_cast<float>(m_col_strides));
310 m_rowPaddingTop = ((m_outputRows - 1) * m_row_strides + m_patch_rows_eff - m_input_rows_eff) / 2;
311 m_colPaddingLeft = ((m_outputCols - 1) * m_col_strides + m_patch_cols_eff - m_input_cols_eff) / 2;
314 m_rowPaddingTop = numext::maxi<Index>(0, m_rowPaddingTop);
315 m_colPaddingLeft = numext::maxi<Index>(0, m_colPaddingLeft);
318 eigen_assert(
false &&
"unexpected padding");
323 eigen_assert(m_outputRows > 0);
324 eigen_assert(m_outputCols > 0);
327 if (
static_cast<int>(Layout) ==
static_cast<int>(
ColMajor)) {
334 m_dimensions[0] = input_dims[0];
335 m_dimensions[1] = op.patch_rows();
336 m_dimensions[2] = op.patch_cols();
337 m_dimensions[3] = m_outputRows * m_outputCols;
338 for (
int i = 4; i < NumDims; ++i) {
339 m_dimensions[i] = input_dims[i-1];
348 m_dimensions[NumDims-1] = input_dims[NumInputDims-1];
349 m_dimensions[NumDims-2] = op.patch_rows();
350 m_dimensions[NumDims-3] = op.patch_cols();
351 m_dimensions[NumDims-4] = m_outputRows * m_outputCols;
352 for (
int i = NumDims-5; i >= 0; --i) {
353 m_dimensions[i] = input_dims[i];
358 if (
static_cast<int>(Layout) ==
static_cast<int>(
ColMajor)) {
359 m_colStride = m_dimensions[1];
360 m_patchStride = m_colStride * m_dimensions[2] * m_dimensions[0];
361 m_otherStride = m_patchStride * m_dimensions[3];
363 m_colStride = m_dimensions[NumDims-2];
364 m_patchStride = m_colStride * m_dimensions[NumDims-3] * m_dimensions[NumDims-1];
365 m_otherStride = m_patchStride * m_dimensions[NumDims-4];
369 m_rowInputStride = m_inputDepth;
370 m_colInputStride = m_inputDepth * m_inputRows;
371 m_patchInputStride = m_inputDepth * m_inputRows * m_inputCols;
374 m_fastOtherStride = internal::TensorIntDivisor<Index>(m_otherStride);
375 m_fastPatchStride = internal::TensorIntDivisor<Index>(m_patchStride);
376 m_fastColStride = internal::TensorIntDivisor<Index>(m_colStride);
377 m_fastInflateRowStride = internal::TensorIntDivisor<Index>(m_row_inflate_strides);
378 m_fastInflateColStride = internal::TensorIntDivisor<Index>(m_col_inflate_strides);
379 m_fastInputColsEff = internal::TensorIntDivisor<Index>(m_input_cols_eff);
382 m_fastOutputRows = internal::TensorIntDivisor<Index>(m_outputRows);
383 if (
static_cast<int>(Layout) ==
static_cast<int>(
ColMajor)) {
384 m_fastOutputDepth = internal::TensorIntDivisor<Index>(m_dimensions[0]);
386 m_fastOutputDepth = internal::TensorIntDivisor<Index>(m_dimensions[NumDims-1]);
390 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Dimensions& dimensions()
const {
return m_dimensions; }
392 EIGEN_STRONG_INLINE
bool evalSubExprsIfNeeded(EvaluatorPointerType ) {
393 m_impl.evalSubExprsIfNeeded(NULL);
397#ifdef EIGEN_USE_THREADS
398 template <
typename EvalSubExprsCallback>
399 EIGEN_STRONG_INLINE
void evalSubExprsIfNeededAsync(
400 EvaluatorPointerType, EvalSubExprsCallback done) {
401 m_impl.evalSubExprsIfNeededAsync(
nullptr, [done](
bool) { done(
true); });
405 EIGEN_STRONG_INLINE
void cleanup() {
409 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index)
const
412 const Index patchIndex = index / m_fastPatchStride;
414 const Index patchOffset = (index - patchIndex * m_patchStride) / m_fastOutputDepth;
417 const Index otherIndex = (NumDims == 4) ? 0 : index / m_fastOtherStride;
418 const Index patch2DIndex = (NumDims == 4) ? patchIndex : (index - otherIndex * m_otherStride) / m_fastPatchStride;
421 const Index colIndex = patch2DIndex / m_fastOutputRows;
422 const Index colOffset = patchOffset / m_fastColStride;
423 const Index inputCol = colIndex * m_col_strides + colOffset * m_in_col_strides - m_colPaddingLeft;
424 const Index origInputCol = (m_col_inflate_strides == 1) ? inputCol : ((inputCol >= 0) ? (inputCol / m_fastInflateColStride) : 0);
425 if (inputCol < 0 || inputCol >= m_input_cols_eff ||
426 ((m_col_inflate_strides != 1) && (inputCol != origInputCol * m_col_inflate_strides))) {
427 return Scalar(m_paddingValue);
431 const Index rowIndex = patch2DIndex - colIndex * m_outputRows;
432 const Index rowOffset = patchOffset - colOffset * m_colStride;
433 const Index inputRow = rowIndex * m_row_strides + rowOffset * m_in_row_strides - m_rowPaddingTop;
434 const Index origInputRow = (m_row_inflate_strides == 1) ? inputRow : ((inputRow >= 0) ? (inputRow / m_fastInflateRowStride) : 0);
435 if (inputRow < 0 || inputRow >= m_input_rows_eff ||
436 ((m_row_inflate_strides != 1) && (inputRow != origInputRow * m_row_inflate_strides))) {
437 return Scalar(m_paddingValue);
440 const int depth_index =
static_cast<int>(Layout) ==
static_cast<int>(
ColMajor) ? 0 : NumDims - 1;
441 const Index depth = index - (index / m_fastOutputDepth) * m_dimensions[depth_index];
443 const Index inputIndex = depth + origInputRow * m_rowInputStride + origInputCol * m_colInputStride + otherIndex * m_patchInputStride;
444 return m_impl.coeff(inputIndex);
447 template<
int LoadMode>
448 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index)
const
450 EIGEN_STATIC_ASSERT((PacketSize > 1), YOU_MADE_A_PROGRAMMING_MISTAKE)
451 eigen_assert(index+PacketSize-1 < dimensions().TotalSize());
453 if (m_in_row_strides != 1 || m_in_col_strides != 1 || m_row_inflate_strides != 1 || m_col_inflate_strides != 1) {
454 return packetWithPossibleZero(index);
457 const Index indices[2] = {index, index + PacketSize - 1};
458 const Index patchIndex = indices[0] / m_fastPatchStride;
459 if (patchIndex != indices[1] / m_fastPatchStride) {
460 return packetWithPossibleZero(index);
462 const Index otherIndex = (NumDims == 4) ? 0 : indices[0] / m_fastOtherStride;
463 eigen_assert(otherIndex == indices[1] / m_fastOtherStride);
466 const Index patchOffsets[2] = {(indices[0] - patchIndex * m_patchStride) / m_fastOutputDepth,
467 (indices[1] - patchIndex * m_patchStride) / m_fastOutputDepth};
469 const Index patch2DIndex = (NumDims == 4) ? patchIndex : (indices[0] - otherIndex * m_otherStride) / m_fastPatchStride;
470 eigen_assert(patch2DIndex == (indices[1] - otherIndex * m_otherStride) / m_fastPatchStride);
472 const Index colIndex = patch2DIndex / m_fastOutputRows;
473 const Index colOffsets[2] = {patchOffsets[0] / m_fastColStride, patchOffsets[1] / m_fastColStride};
476 const Index inputCols[2] = {colIndex * m_col_strides + colOffsets[0] -
477 m_colPaddingLeft, colIndex * m_col_strides + colOffsets[1] - m_colPaddingLeft};
478 if (inputCols[1] < 0 || inputCols[0] >= m_inputCols) {
479 return internal::pset1<PacketReturnType>(Scalar(m_paddingValue));
482 if (inputCols[0] == inputCols[1]) {
483 const Index rowIndex = patch2DIndex - colIndex * m_outputRows;
484 const Index rowOffsets[2] = {patchOffsets[0] - colOffsets[0]*m_colStride, patchOffsets[1] - colOffsets[1]*m_colStride};
485 eigen_assert(rowOffsets[0] <= rowOffsets[1]);
487 const Index inputRows[2] = {rowIndex * m_row_strides + rowOffsets[0] -
488 m_rowPaddingTop, rowIndex * m_row_strides + rowOffsets[1] - m_rowPaddingTop};
490 if (inputRows[1] < 0 || inputRows[0] >= m_inputRows) {
491 return internal::pset1<PacketReturnType>(Scalar(m_paddingValue));
494 if (inputRows[0] >= 0 && inputRows[1] < m_inputRows) {
496 const int depth_index =
static_cast<int>(Layout) ==
static_cast<int>(
ColMajor) ? 0 : NumDims - 1;
497 const Index depth = index - (index / m_fastOutputDepth) * m_dimensions[depth_index];
498 const Index inputIndex = depth + inputRows[0] * m_rowInputStride + inputCols[0] * m_colInputStride + otherIndex * m_patchInputStride;
499 return m_impl.template packet<Unaligned>(inputIndex);
503 return packetWithPossibleZero(index);
506 EIGEN_DEVICE_FUNC EvaluatorPointerType data()
const {
return NULL; }
508 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const TensorEvaluator<ArgType, Device>& impl()
const {
return m_impl; }
512 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void bind(cl::sycl::handler &cgh)
const {
517 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
Index rowPaddingTop()
const {
return m_rowPaddingTop; }
518 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
Index colPaddingLeft()
const {
return m_colPaddingLeft; }
519 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
Index outputRows()
const {
return m_outputRows; }
520 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
Index outputCols()
const {
return m_outputCols; }
521 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
Index userRowStride()
const {
return m_row_strides; }
522 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
Index userColStride()
const {
return m_col_strides; }
523 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
Index userInRowStride()
const {
return m_in_row_strides; }
524 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
Index userInColStride()
const {
return m_in_col_strides; }
525 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
Index rowInflateStride()
const {
return m_row_inflate_strides; }
526 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
Index colInflateStride()
const {
return m_col_inflate_strides; }
528 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost
529 costPerCoeff(
bool vectorized)
const {
533 const double compute_cost = 3 * TensorOpCost::DivCost<Index>() +
534 6 * TensorOpCost::MulCost<Index>() +
535 8 * TensorOpCost::MulCost<Index>();
536 return m_impl.costPerCoeff(vectorized) +
537 TensorOpCost(0, 0, compute_cost, vectorized, PacketSize);
541 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packetWithPossibleZero(Index index)
const
543 EIGEN_ALIGN_MAX
typename internal::remove_const<CoeffReturnType>::type values[PacketSize];
545 for (
int i = 0; i < PacketSize; ++i) {
546 values[i] = coeff(index+i);
548 PacketReturnType rslt = internal::pload<PacketReturnType>(values);
552 Dimensions m_dimensions;
560 Index m_in_row_strides;
561 Index m_in_col_strides;
562 Index m_row_inflate_strides;
563 Index m_col_inflate_strides;
565 Index m_input_rows_eff;
566 Index m_input_cols_eff;
567 Index m_patch_rows_eff;
568 Index m_patch_cols_eff;
570 internal::TensorIntDivisor<Index> m_fastOtherStride;
571 internal::TensorIntDivisor<Index> m_fastPatchStride;
572 internal::TensorIntDivisor<Index> m_fastColStride;
573 internal::TensorIntDivisor<Index> m_fastInflateRowStride;
574 internal::TensorIntDivisor<Index> m_fastInflateColStride;
575 internal::TensorIntDivisor<Index> m_fastInputColsEff;
577 Index m_rowInputStride;
578 Index m_colInputStride;
579 Index m_patchInputStride;
588 Index m_rowPaddingTop;
589 Index m_colPaddingLeft;
591 internal::TensorIntDivisor<Index> m_fastOutputRows;
592 internal::TensorIntDivisor<Index> m_fastOutputDepth;
594 Scalar m_paddingValue;
596 const Device EIGEN_DEVICE_REF m_device;
597 TensorEvaluator<ArgType, Device> m_impl;
Namespace containing all symbols from the Eigen library.
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index