From bae3b67499db6bf8a1a5fa22c726c22d6bd7010a Mon Sep 17 00:00:00 2001 From: Francisco Massa Date: Thu, 14 Apr 2016 01:06:40 +0200 Subject: [PATCH] Assert that dim is integer in Normalize --- Normalize.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Normalize.lua b/Normalize.lua index f41dba9f0..56e97619c 100644 --- a/Normalize.lua +++ b/Normalize.lua @@ -12,6 +12,7 @@ end function Normalize:updateOutput(input) assert(math.abs(self.dim) <= input:dim(), 'input has less dimensions than the normalization dimension') + assert(self.dim % 1 == 0, 'dimension should be an integer') local dim = self.dim if dim < 0 then dim = input:dim() + dim + 1 @@ -47,6 +48,7 @@ end function Normalize:updateGradInput(input, gradOutput) assert(math.abs(self.dim) <= input:dim(), 'input has less dimensions than the normalization dimension') + assert(self.dim % 1 == 0, 'dimension should be an integer') local dim = self.dim if dim < 0 then dim = input:dim() + dim + 1