InsertZeros< TensorType > Struct Template Reference

Public Member Functions

DSizes< DenseIndex, 2 > dimensions (const Tensor< float, 2 > &input) const
 
template<typename Output , typename Device >
void eval (const Tensor< float, 2 > &input, Output &output, const Device &device) const
 
DSizes< DenseIndex, 2 > dimensions (const TensorType &input) const
 
template<typename Output , typename Device >
void eval (const TensorType &input, Output &output, const Device &device) const
 

Member Function Documentation

◆ dimensions() [1/2]

template<typename TensorType >
DSizes<DenseIndex, 2> InsertZeros< TensorType >::dimensions ( const Tensor< float, 2 > &  input) const
inline
17  {
18  DSizes<DenseIndex, 2> result;
19  result[0] = input.dimension(0) * 2;
20  result[1] = input.dimension(1) * 2;
21  return result;
22  }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index dimension(std::size_t n) const
Definition: Tensor.h:99
Definition: TensorDimensions.h:161

References Eigen::Tensor< Scalar_, NumIndices_, Options_, IndexType_ >::dimension().

◆ dimensions() [2/2]

template<typename TensorType >
DSizes<DenseIndex, 2> InsertZeros< TensorType >::dimensions ( const TensorType &  input) const
inline
26  {
27  DSizes<DenseIndex, 2> result;
28  result[0] = input.dimension(0) * 2;
29  result[1] = input.dimension(1) * 2;
30  return result;
31  }

◆ eval() [1/2]

template<typename TensorType >
template<typename Output , typename Device >
void InsertZeros< TensorType >::eval ( const Tensor< float, 2 > &  input,
Output &  output,
const Device &  device 
) const
inline
25  {
27  strides[0] = 2;
28  strides[1] = 2;
29  output.stride(strides).device(device) = input;
30 
31  Eigen::DSizes<DenseIndex, 2> offsets(1, 1);
32  Eigen::DSizes<DenseIndex, 2> extents(output.dimension(0) - 1, output.dimension(1) - 1);
33  output.slice(offsets, extents).stride(strides).device(device) = input.constant(0.0f);
34  }
EIGEN_ALWAYS_INLINE DSizes< IndexType, NumDims > strides(const DSizes< IndexType, NumDims > &dimensions)
Definition: TensorBlock.h:29
std::array< T, N > array
Definition: EmulateArray.h:231
void output(std::ostream &outfile, const unsigned &nplot)
Overload output function.
Definition: overloaded_element_body.h:490

References output(), and Eigen::internal::strides().

◆ eval() [2/2]

template<typename TensorType >
template<typename Output , typename Device >
void InsertZeros< TensorType >::eval ( const TensorType &  input,
Output &  output,
const Device &  device 
) const
inline
34  {
36  strides[0] = 2;
37  strides[1] = 2;
38  output.stride(strides).device(device) = input;
39 
40  Eigen::DSizes<DenseIndex, 2> offsets(1, 1);
41  Eigen::DSizes<DenseIndex, 2> extents(output.dimension(0) - 1, output.dimension(1) - 1);
42  output.slice(offsets, extents).stride(strides).device(device) = input.constant(0.0f);
43  }

References output(), and Eigen::internal::strides().


The documentation for this struct was generated from the following files: