commit | 8f3f90a9865cef172bbfe281d4a0706a1f94eeda | [log] [tgz] |
---|---|---|
author | Gregory Chanan <gchanan@fb.com> | Wed Aug 31 19:17:23 2016 -0700 |
committer | Gregory Chanan <gchanan@fb.com> | Wed Aug 31 19:31:41 2016 -0700 |
tree | 07c6dda03ef1338ee42eaa67a63790832a7f35a7 | |
parent | 5fef59beb45da5b6b3bc0da2b0e5c904eef0e9d6 [diff] |
inplace is reversed in HardTanh:backward. Fixes torch7 issue #734, "Inconsistent behavior of nn.Clamp in CPU and GPU modes". Adds a simple test that gradOutput equals gradInput after backward when inplace is set. It is possible to construct a test with inplace HardTanh where forward+backward yields different results for nn vs cunn, but this appears to be due to the inclusive vs exclusive bounds used for inplace vs non-inplace, respectively, so a more direct test is preferred.