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

Avoid memory copy for dropout inference #15521

Merged
merged 4 commits into from
Jul 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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