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

Commit

Permalink
Avoid memory copy for dropout inference (#15521)
Browse files Browse the repository at this point in the history
* fix dropout for inference
  • Loading branch information
TaoLv authored and wkcn committed Jul 15, 2019
1 parent b88705e commit 9724ce6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/operator/nn/dropout-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ class DropoutOp {
}
}
} else {
if (req[dropout::kOut] == kWriteInplace) return;

MXNET_ASSIGN_REQ_SWITCH(req[dropout::kOut], Req, {
mxnet_op::Kernel<mxnet_op::op_with_req<mshadow_op::identity, Req>, xpu>::Launch(
s, out.Size(), out.dptr<DType>(), in.dptr<DType>());
Expand Down

0 comments on commit 9724ce6

Please sign in to comment.