diff options
author | soumith <soumith@fb.com> | 2014-11-26 06:11:14 +0300 |
---|---|---|
committer | soumith <soumith@fb.com> | 2014-11-26 06:12:14 +0300 |
commit | 875067f4eb6f5c8eab77ee1acd030fd5e2225fc5 (patch) | |
tree | ebfe4a97600a40947dfb0a875ea67840f8c0d81c /SpatialSoftMax.lua | |
parent | b0e6e3f0ad10e931a1f83197b127a442e179e67e (diff) |
lint fixes
Diffstat (limited to 'SpatialSoftMax.lua')
-rw-r--r-- | SpatialSoftMax.lua | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/SpatialSoftMax.lua b/SpatialSoftMax.lua index e245f24..3a4106d 100644 --- a/SpatialSoftMax.lua +++ b/SpatialSoftMax.lua @@ -1,6 +1,4 @@ local SpatialSoftMax, parent = torch.class('cudnn.SpatialSoftMax', 'nn.Module') -local ffi = require 'ffi' -local C = cudnn.C local errcheck = cudnn.errcheck function SpatialSoftMax:__init(fast) @@ -30,8 +28,12 @@ function SpatialSoftMax:createIODescriptors(input) self.iDesc = cudnn.toDescriptor(input) self.oDesc = cudnn.toDescriptor(self.output) if not batch then - self.gradInput = self.gradInput:view(self.gradInput:size(2), self.gradInput:size(3), self.gradInput:size(4)) - self.output = self.output:view(self.output:size(2), self.output:size(3), self.output:size(4)) + self.gradInput = self.gradInput:view(self.gradInput:size(2), + self.gradInput:size(3), + self.gradInput:size(4)) + self.output = self.output:view(self.output:size(2), + self.output:size(3), + self.output:size(4)) end end end @@ -47,7 +49,8 @@ function SpatialSoftMax:updateOutput(input) end function SpatialSoftMax:updateGradInput(input, gradOutput) - assert((gradOutput:dim() == 4 or gradOutput:dim() == 3) and gradOutput:isContiguous()); + assert((gradOutput:dim() == 4 or gradOutput:dim() == 3) + and gradOutput:isContiguous()); self:createIODescriptors(input) errcheck('cudnnSoftmaxBackward', cudnn.handle[cutorch.getDevice()-1], |