17#ifndef __NNFW_CKER_TRAIN_OPERATION_FULLY_CONNECTED_H__
18#define __NNFW_CKER_TRAIN_OPERATION_FULLY_CONNECTED_H__
32 const Shape &grad_shape, T *grad_data)
34 const auto bias_size = grad_shape.
FlatSize();
36 bias_size != grad_shape.
Dims(0))
37 throw std::runtime_error(
"cker::FullyConnectedBiasGrad: Unmatched shape");
42 grad_mat = in_mat.rowwise().sum();
int32_t DimensionsCount() const
int32_t Dims(int i) const
void FullyConnectedBiasGrad(const Shape &incomming_shape, const T *incomming_data, const Shape &grad_shape, T *grad_data)
MatrixMap< Scalar > MapAsMatrixWithLastDimAsRows(Scalar *data, const Shape &shape)