diff options
author | Sergey Zagoruyko <zagoruyko2@gmail.com> | 2016-07-19 21:58:34 +0300 |
---|---|---|
committer | Sergey Zagoruyko <zagoruyko2@gmail.com> | 2016-07-19 21:58:34 +0300 |
commit | f3586546caeed9918c0235007650657083c44a64 (patch) | |
tree | f7469e728ce5ef585ae6f9054ca4d7be59621576 | |
parent | 3427b3dc615264cb1d4b31cdd6923ab865ef53d3 (diff) |
pooling check size assert
-rw-r--r-- | Pooling.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Pooling.lua b/Pooling.lua index 45afccb..53220f1 100644 --- a/Pooling.lua +++ b/Pooling.lua @@ -61,6 +61,7 @@ function Pooling:createIODescriptors(input) oW = math.floor((input:size(4)+self.padW*2 - self.kW)/self.dW + 1) oH = math.floor((input:size(3)+self.padH*2 - self.kH)/self.dH + 1) end + assert(oW > 0 and oH > 0, 'input image smaller than kernel') self.output:resize(input:size(1), input:size(2), oH, oW) -- create input/output descriptor |