Fix clearState
This commit is contained in:
parent
5ed13d6c1b
commit
fd06a47d56
1 changed files with 2 additions and 2 deletions
|
@ -19,10 +19,10 @@ end
|
||||||
|
|
||||||
function nn.SpatialConvolutionMM:clearState()
|
function nn.SpatialConvolutionMM:clearState()
|
||||||
if self.gradWeight then
|
if self.gradWeight then
|
||||||
self.gradWeight = torch.Tensor(self.nOutputPlane, self.nInputPlane * self.kH * self.kW):typeAs(self.gradWeight):zero()
|
self.gradWeight:resize(self.nOutputPlane, self.nInputPlane * self.kH * self.kW):zero()
|
||||||
end
|
end
|
||||||
if self.gradBias then
|
if self.gradBias then
|
||||||
self.gradBias = torch.Tensor(self.nOutputPlane):typeAs(self.gradBias):zero()
|
self.gradBias:resize(self.nOutputPlane):zero()
|
||||||
end
|
end
|
||||||
return nn.utils.clear(self, 'finput', 'fgradInput', '_input', '_gradOutput', 'output', 'gradInput')
|
return nn.utils.clear(self, 'finput', 'fgradInput', '_input', '_gradOutput', 'output', 'gradInput')
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue