ONE - On-device Neural Engine
Loading...
Searching...
No Matches
nnfw::cker::functor::StrideFunctor< Device, T, N > Struct Template Reference

#include <Einsum.h>

Public Member Functions

void operator() (const Device &d, typename TTypes< T, N >::ConstTensor input, const std::vector< int32_t > &strides, typename TTypes< T, N >::Tensor output)
 

Detailed Description

template<typename Device, typename T, int N>
struct nnfw::cker::functor::StrideFunctor< Device, T, N >

Definition at line 45 of file Einsum.h.

Member Function Documentation

◆ operator()()

template<typename Device , typename T , int N>
void nnfw::cker::functor::StrideFunctor< Device, T, N >::operator() ( const Device &  d,
typename TTypes< T, N >::ConstTensor  input,
const std::vector< int32_t > &  strides,
typename TTypes< T, N >::Tensor  output 
)
inline

Definition at line 47 of file Einsum.h.

49 {
50
51 Eigen::DSizes<Eigen::DenseIndex, N> dsizes;
52 for (size_t d = 0; d < strides.size(); d++)
53 {
54 dsizes[d] = static_cast<Eigen::DenseIndex>(strides[d]);
55 }
56 for (size_t d = strides.size(); d < N; d++)
57 {
58 dsizes[d] = 1;
59 }
60
61 output.device(d) = input.stride(dsizes);
62 }

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