diff options
author | Sergio Gomez <sergomez@google.com> | 2016-02-19 17:28:01 +0300 |
---|---|---|
committer | Sergio Gomez <sergomez@google.com> | 2016-02-19 17:36:25 +0300 |
commit | a30f4bf6e035e5241a20a9c9d83251f8304de9f2 (patch) | |
tree | d5952c6096c70ff77279930eaef44b715d3e159a /SpatialReSampling.lua | |
parent | 8bd6a2545aae0f9af9b58c3c667e8a2288cbd937 (diff) |
Extra checks and cleanup in C code
This fixes a memory leak in SpatialLinear (added a missing THTensor_free())
Diffstat (limited to 'SpatialReSampling.lua')
-rw-r--r-- | SpatialReSampling.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/SpatialReSampling.lua b/SpatialReSampling.lua index 7324098..e83f8f2 100644 --- a/SpatialReSampling.lua +++ b/SpatialReSampling.lua @@ -31,6 +31,9 @@ function SpatialReSampling:__init(...) end function SpatialReSampling:updateOutput(input) + assert(input:dim() == 3 or input:dim() == 4, + 'input to SpatialReSampling must be 3D or 4D, received: [' .. + table.concat(input:size():totable(), ', ') .. ']') local hDim, wDim = 2, 3 if input:dim() == 4 then hDim, wDim = 3, 4 |