ONE - On-device Neural Engine
Loading...
Searching...
No Matches
nnfw::cker::functor Namespace Reference

Data Structures

struct  BroadcastTo
 
struct  FillFunctor
 
struct  FillFunctor< Eigen::ThreadPoolDevice, T >
 
struct  FillPhiloxRandom
 
struct  FillPhiloxRandom< CPUDevice, Distribution >
 
struct  FillPhiloxRandomTask
 
struct  FillPhiloxRandomTask< Distribution, false >
 
struct  FillPhiloxRandomTask< Distribution, true >
 
struct  InflateFunctor
 
struct  ReduceFunctor
 
struct  ReduceOuterDimensions
 
struct  SetZeroFunctor
 
struct  StrideFunctor
 

Typedefs

typedef Eigen::ThreadPoolDevice CPUDevice
 

Functions

void biasReductionHelper (float *input_backprop_buffer, const Shape &input_backprop_shape, float *bias_grad_buffer, const Shape &bias_grad_shape)
 

Typedef Documentation

◆ CPUDevice

typedef Eigen::ThreadPoolDevice nnfw::cker::functor::CPUDevice

Definition at line 37 of file RandomOp.h.

Function Documentation

◆ biasReductionHelper()

void nnfw::cker::functor::biasReductionHelper ( float *  input_backprop_buffer,
const Shape input_backprop_shape,
float *  bias_grad_buffer,
const Shape bias_grad_shape 
)

Definition at line 193 of file redux_functor.h.

195{
196 assert(input_backprop_buffer);
197 assert(bias_grad_buffer);
198
199 const nnfw::cker::functor::ReduceOuterDimensions<Eigen::ThreadPoolDevice, float, float, float,
200 Eigen::internal::scalar_sum_op<float>>
201 redux;
202
203 const Tensor input_backprop_t{input_backprop_shape, static_cast<void *>(input_backprop_buffer)};
204
205 Tensor bias_grad_t{bias_grad_shape, bias_grad_buffer};
206
207 int outer = 1;
208 for (int i = 0; i < input_backprop_shape.DimensionsCount() - 1; ++i)
209 outer *= input_backprop_shape.Dims(i);
210 int inner = input_backprop_shape.Dims(input_backprop_shape.DimensionsCount() - 1);
211
212 redux(*eigen_support::GetThreadPoolDevice(), Eigen::DSizes<Eigen::Index, 2>{outer, inner},
213 input_backprop_t, &bias_grad_t);
214}
int32_t DimensionsCount() const
Definition Shape.h:91
int32_t Dims(int i) const
Definition Shape.h:92

References nnfw::cker::Shape::DimensionsCount(), nnfw::cker::Shape::Dims(), and nnfw::cker::eigen_support::GetThreadPoolDevice().

Referenced by onert::backend::train::ops::biasGrad().