From 3cb51397b52ca9a2a775a350fc70b1c359eb979a Mon Sep 17 00:00:00 2001 From: nagadomi Date: Thu, 1 Nov 2018 15:51:11 +0900 Subject: [PATCH] Fix backward compatibility problem due to groups --- SpatialConvolution.lua | 1 + SpatialFullConvolution.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/SpatialConvolution.lua b/SpatialConvolution.lua index 23e92b9..8248c16 100644 --- a/SpatialConvolution.lua +++ b/SpatialConvolution.lua @@ -29,6 +29,7 @@ end function SpatialConvolution:resetWeightDescriptors(desc) assert(cudnn.typemap[torch.typename(self.weight)], 'Only Cuda supported duh!') assert(cudnn.typemap[torch.typename(self.bias)] or not self.bias, 'Only Cuda supported duh!') + self.groups = self.groups or 1 -- create descriptor for bias if self.bias then diff --git a/SpatialFullConvolution.lua b/SpatialFullConvolution.lua index 9093ce4..fe4703d 100644 --- a/SpatialFullConvolution.lua +++ b/SpatialFullConvolution.lua @@ -27,6 +27,7 @@ function SpatialFullConvolution:__init(nInputPlane, nOutputPlane, end function SpatialFullConvolution:resetWeightDescriptors() + self.groups = self.groups or 1 return Convolution.resetWeightDescriptors(self, {self.nInputPlane, self.nOutputPlane/self.groups, self.kH, self.kW})