Skip to content

Commit

Permalink
Merge pull request torch#273 from szagoruyko/master
Browse files Browse the repository at this point in the history
moved zeroing to blas side in batch nn.Linear:forward
  • Loading branch information
soumith committed May 23, 2015
2 parents 3dd5d1d + 8abe926 commit 1cca535
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Linear.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ function Linear:updateOutput(input)
self.output:copy(self.bias:view(1,nunit):expand(#self.output))
self.output:select(2,1):addmv(1, input, self.weight:select(1,1))
else
self.output:zero():addr(1, self.addBuffer, self.bias)
self.output:addmm(1, input, self.weight:t())
self.output:addmm(0, self.output, 1, input, self.weight:t())
self.output:addr(1, self.addBuffer, self.bias)
end
else
error('input must be vector or matrix')
Expand Down

0 comments on commit 1cca535

Please sign in to comment.