35 : cpu::
ops::
MeanLayer(), _back_prop_input{nullptr}, _back_prop_output{nullptr}
43 _back_prop_input = back_prop_input;
44 _back_prop_output = back_prop_output;
59 for (
const auto &axis : axes_vec)
61 keep_dim_shape.
SetDim(axis, 1);
71 case OperandType::FLOAT32:
74 getShape(_back_prop_input), getBuffer<float>(_back_prop_input));
78 throw std::runtime_error(
"train MeanLayer: unsupported data type");
void ReplaceWith(int dimensions_count, const int32_t *dims_data)
void SetDim(int i, int32_t val)
A tensor class that is portable for other backends.
ir::DataType data_type() const override final
const IPortableTensor * _input
const IPortableTensor * _axes
void configureBackward(IPortableTensor *back_prop_input, const IPortableTensor *back_prop_output)
void forward(bool training) override
void MeanGrad(const Shape &incoming_shape, const T *incoming_data, const Shape &grad_shape, T *grad_data)
std::vector< int32_t > getReducerAxes(const IPortableTensor *axes)
nnfw::cker::Shape getShape(const IPortableTensor *tensor)
Get shape of tensor.