1
0
Fork 0
mirror of synced 2024-09-30 17:27:44 +13:00

Fix clearState

This commit is contained in:
nagadomi 2016-03-28 18:38:01 +09:00
parent 5ed13d6c1b
commit fd06a47d56

View file

@ -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