Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jiajie.tang committed Nov 26, 2018
1 parent 21850b2 commit 76c1e1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/operator/contrib/corner_pooling-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,11 @@ inline void corner_pool_grad(mshadow::Stream<cpu> *s,
const int corner_pooling_type,
OpReqType req_type,
DType *in_grad) {
mxnet_op::Kernel<mxnet_op::set_zero, cpu>::Launch(s, ishape.Size(),
in_grad);
if (mxnet::kNullOp == req_type) return;
if (mxnet::kAddTo != req_type) {
mxnet_op::Kernel<mxnet_op::set_zero, cpu>::Launch(s, ishape.Size(),
in_grad);
}
const int height = ishape[2], width = ishape[3];
const index_t data_offset = width * height;
if (corner_pooling_type == 0 || corner_pooling_type == 1) {
Expand Down
8 changes: 5 additions & 3 deletions src/operator/contrib/corner_pooling.cu
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,11 @@ inline void corner_pool_grad(mshadow::Stream<gpu> *s,
const DType *out_data, const TShape &ishape,
const int corner_pooling_type, OpReqType req_type,
DType *in_grad) {
mxnet_op::Kernel<mxnet_op::set_zero, gpu>::Launch(s, ishape.Size(),
in_grad);

if (mxnet::kNullOp == req_type) return;
if (mxnet::kAddTo != req_type) {
mxnet_op::Kernel<mxnet_op::set_zero, gpu>::Launch(s, ishape.Size(),
in_grad);
}
const int height = ishape[2], width = ishape[3];
if (corner_pooling_type == 0 || corner_pooling_type == 1) {
// top or bottom
Expand Down

0 comments on commit 76c1e1c

Please sign in to comment.