torch/nn — pull request #59 by jonathantompson (2014-07-30 23:06:52+00:00)
Title: Removed redundant multiplication from Threshold.c

This is a REALLY small one. I would like to change Threshold so that it doesn't perform a multiplication.

The real reason I want this change is because I want to share gradOutputs across convolution and threshold modules... So the memory location for gradInput and gradOutput are the same (to save memory). For the old code this wont work because the gradOutput gets set to 1: losing the previous value.

Note that the cunn implementation does not do this multiply. I'm not sure why the logic was written this way in the first place.