From 88c391a6842a117c357163f94b41c040621be9ba Mon Sep 17 00:00:00 2001 From: koray kavukcuoglu Date: Thu, 13 Sep 2012 16:16:26 -0400 Subject: corrected bug in backward of nn.Square --- generic/Square.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'generic') diff --git a/generic/Square.c b/generic/Square.c index 33feaa9..4e20116 100644 --- a/generic/Square.c +++ b/generic/Square.c @@ -40,7 +40,7 @@ static int nn_(Square_updateGradInput)(lua_State *L) !THTensor_(isContiguous)(gradInput)) { TH_TENSOR_APPLY3(real, gradInput, real, gradOutput, real, input, \ - *gradInput_data = (*gradOutput_data) * (*input_data);); + *gradInput_data = 2.0 * (*gradOutput_data) * (*input_data);); } else { -- cgit v1.2.3