Skip to content

Commit 3371428

Browse files
author
Nicholas Leonard
committed
small fixes
1 parent f1945f5 commit 3371428

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ArgMax.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ local ArgMax, parent = torch.class("nn.ArgMax", "nn.Module")
99
function ArgMax:__init(dim, nInputDim, asLong)
1010
parent.__init(self)
1111
self.dim = dim or 1
12-
self.nInputDim = nInputDim or 9999
12+
self.nInputDim = nInputDim or 1
1313
self.asLong = (asLong == nil) and true or asLong
1414
if self.asLong then
1515
self.output = torch.LongTensor()
@@ -21,7 +21,7 @@ function ArgMax:updateOutput(input)
2121
self._indices = self._indices or
2222
(torch.type(input) == 'torch.CudaTensor' and (torch.CudaLongTensor and torch.CudaLongTensor() or torch.CudaTensor()) or torch.LongTensor())
2323
local dim = (input:dim() > self.nInputDim) and (self.dim + 1) or self.dim
24-
24+
2525
torch.max(self._value, self._indices, input, dim)
2626
if input:dim() > 1 then
2727
local idx = self._indices:select(dim, 1)

Criterion.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ function Criterion:setZeroMask(zeroMask)
1616
end
1717

1818
function Criterion:clearState()
19-
return nn.utils.clear(self, 'gradInput')
19+
return nn.utils.clear(self, 'gradInput')
2020
end

0 commit comments

Comments
 (0)