Fix some bug.

cblas_new
hedaoyuan 8 years ago
parent 4b1bc6815e
commit d456c28609

@ -87,7 +87,7 @@ void SliceProjection::backward(const UpdateCallback& callback) {
size_t offset = 0; size_t offset = 0;
for (auto& slice : slices_) { for (auto& slice : slices_) {
auto slice_out = in_->grad->subColMatrix(slice.first, slice.second); auto slice_out = in_->grad->subColMatrix(slice.first, slice.second);
slice_out->addAtOffset(*out_->grad, config_.offset()); slice_out->addAtOffset(*out_->grad, offset);
offset += slice_out->getWidth(); offset += slice_out->getWidth();
} }
} }

@ -167,7 +167,7 @@ TEST(Projection, slice) {
testProjectionGrad(conf, testProjectionGrad(conf,
INPUT_DATA, INPUT_DATA,
/* parameterSize */ 0, /* parameterSize */ 0,
/* batchSize */ 100, /* batchSize */ 10,
useGpu); useGpu);
} }
} }

Loading…
Cancel
Save