Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpatialSubtractiveNormalization:clearState() missing several cleanups #1303

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
10 changes: 6 additions & 4 deletions SpatialSubtractiveNormalization.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ function SpatialSubtractiveNormalization:updateGradInput(input, gradOutput)
end

function SpatialSubtractiveNormalization:clearState()
if self.ones then self.ones:set() end
if self._coef then self._coef:set() end
self.meanestimator:clearState()
return parent.clearState(self)
nn.utils.clear(self, '_inpsz', 'ones', '_coef')
self.coef = torch.Tensor(1,1,1)
self.subtractor:clearState()
self.divider:clearState()
self.meanestimator:clearState()
return parent.clearState(self)
end