Skip to content

Commit

Permalink
Make sure Elu alpha is strictly positive
Browse files Browse the repository at this point in the history
Reviewed By: Yangqing

Differential Revision: D5289483

fbshipit-source-id: 96223304e4b1278595bae5ed137b5b80b7f8f521
  • Loading branch information
Ahmed Taei authored and facebook-github-bot committed Jun 21, 2017
1 parent 29f037f commit 43afb1d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions caffe2/operators/elu_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ template <>
bool EluOp<float, CPUContext>::RunOnDevice() {
auto& X = Input(0);
auto* Y = Output(0);
// Otherwise inplace gradient and Elu dosen't make sense.
CAFFE_ENFORCE_GE(alpha_, 0);
Y->ResizeLike(X);
const auto* Xdata = X.template data<float>();
auto* Ydata = Y->template mutable_data<float>();
Expand Down

0 comments on commit 43afb1d

Please sign in to comment.