Skip to content

Commit

Permalink
Merge pull request torch#296 from fmassa/conv_fix
Browse files Browse the repository at this point in the history
Fix print and correct non-contiguous test in SpatialConvolutionMM
  • Loading branch information
soumith committed Jun 19, 2015
2 parents a98f4b8 + cc37251 commit c293e84
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SpatialConvolution.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function SpatialConvolution:__tostring__()
if self.padding and self.padding ~= 0 then
s = s .. ', ' .. self.padding .. ',' .. self.padding
elseif (self.padW or self.padH) and (self.padW ~= 0 or self.padH ~= 0) then
s = s .. ', ' .. self.padW .. ',' .. self.padW
s = s .. ', ' .. self.padW .. ',' .. self.padH
end
return s .. ')'
end
2 changes: 1 addition & 1 deletion SpatialConvolutionMM.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function SpatialConvolutionMM:__tostring__()
if self.padding and self.padding ~= 0 then
s = s .. ', ' .. self.padding .. ',' .. self.padding
elseif (self.padW or self.padH) and (self.padW ~= 0 or self.padH ~= 0) then
s = s .. ', ' .. self.padW .. ',' .. self.padW
s = s .. ', ' .. self.padW .. ',' .. self.padH
end
return s .. ')'
end
2 changes: 1 addition & 1 deletion test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,7 @@ function nntest.SpatialConvolutionMM()
mytester:asserteq(0, berr, torch.typename(module) .. ' - i/o backward err ')

-- non-contiguous
local input = torch.randn(batch,from,inj,ini):transpose(3,4) -- non-contiguous
local input = torch.randn(batch,from,ini,inj):transpose(3,4) -- non-contiguous
local inputc = input:contiguous() -- contiguous
local output = module:forward(input)
local outputc = module:forward(inputc)
Expand Down

0 comments on commit c293e84

Please sign in to comment.