From 875067f4eb6f5c8eab77ee1acd030fd5e2225fc5 Mon Sep 17 00:00:00 2001 From: soumith Date: Tue, 25 Nov 2014 19:11:14 -0800 Subject: lint fixes --- SpatialSoftMax.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'SpatialSoftMax.lua') 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], -- cgit v1.2.3