}
bool ActiFunc::supportInPlace() const {
- bool support_in_place = true;
+ bool support_in_place = in_place;
if (activation_type == ActivationType::ACT_SOFTMAX)
support_in_place = false;
void CrossEntropySigmoidLossLayer::forwarding(RunLayerContext &context,
bool training) {
Tensor &hidden_ = context.getOutput(SINGLE_INOUT_IDX);
- // TODO: try Tensor & - it should work
- Tensor y = context.getInput(SINGLE_INOUT_IDX);
+ Tensor &y = context.getInput(SINGLE_INOUT_IDX);
// fill the output
hidden_ = y.apply(ActiFunc::sigmoid, hidden_);
void CrossEntropySoftmaxLossLayer::forwarding(RunLayerContext &context,
bool training) {
Tensor &hidden_ = context.getOutput(SINGLE_INOUT_IDX);
- // TODO: try Tensor & - it should work
- Tensor y = context.getInput(SINGLE_INOUT_IDX);
+ Tensor &y = context.getInput(SINGLE_INOUT_IDX);
// fill the output
hidden_ = y.apply(ActiFunc::softmax, hidden_);
void MSELossLayer::forwarding(RunLayerContext &context, bool training) {
Tensor &hidden_ = context.getOutput(SINGLE_INOUT_IDX);
- // TODO: try Tensor & - it should work
- Tensor y = context.getInput(SINGLE_INOUT_IDX);
+ Tensor &y = context.getInput(SINGLE_INOUT_IDX);
Tensor l;
// fill the output