diff options
author | Soumith Chintala <soumith@gmail.com> | 2017-03-24 03:29:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-24 03:29:17 +0300 |
commit | 73beb06aadcde380e1536282f11296b332284ee3 (patch) | |
tree | 2ec2e23f922f5e78d37e11eeab5622553f864e9a | |
parent | 6b6a462d9e0781957f66ab209f051201cdb190de (diff) | |
parent | 67e30aefbd032982592fbdb201016e0303cad336 (diff) |
Merge pull request #454 from ngimel/patch-1
Fix inconsistent in-place and out-of-place for HardTanh
-rw-r--r-- | lib/THCUNN/HardTanh.cu | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/THCUNN/HardTanh.cu b/lib/THCUNN/HardTanh.cu index 0543a4c..5921f7f 100644 --- a/lib/THCUNN/HardTanh.cu +++ b/lib/THCUNN/HardTanh.cu @@ -46,7 +46,7 @@ struct hardtanhupdateGradInput_functor __device__ void operator()(T *gradInput, const T *input, const T *gradOutput) const { - if (*input < min_val_ || *input > max_val_) + if (*input <= min_val_ || *input >= max_val_) *gradInput = ScalarConvert<int, T>::to(0); else *gradInput = *gradOutput; |