From 501dc97f6720f448c8e4fc4fa70829230afe987e Mon Sep 17 00:00:00 2001 From: soumith Date: Thu, 17 Mar 2016 15:11:17 -0400 Subject: add _input and _gradOutput to clearState everywhere --- SpatialSoftMax.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'SpatialSoftMax.lua') diff --git a/SpatialSoftMax.lua b/SpatialSoftMax.lua index f180526..493477f 100644 --- a/SpatialSoftMax.lua +++ b/SpatialSoftMax.lua @@ -30,7 +30,7 @@ function SpatialSoftMax:createIODescriptors(input) batch = false end assert(input:dim() == 4 and input:isContiguous()); - + if not self.iDesc or not self.oDesc or input:size(1) ~= self.iSize[1] or input:size(2) ~= self.iSize[2] or input:size(3) ~= self.iSize[3] or input:size(4) ~= self.iSize[4] then @@ -106,6 +106,6 @@ end function SpatialSoftMax:clearState() self:clearDesc() - nn.utils.clear(self, '_gradOutput') + self._gradOutput = nil return parent.clearState(self) end -- cgit v1.2.3