diff options
author | Sergey Zagoruyko <zagoruyko2@gmail.com> | 2016-02-08 03:22:07 +0300 |
---|---|---|
committer | Sergey Zagoruyko <zagoruyko2@gmail.com> | 2016-02-09 21:42:51 +0300 |
commit | 4696a46212ffc5bb54b0d8f3327dfa47693bbfdf (patch) | |
tree | 5f4512a8ead3d952d17a9a82c200a60ba6cb5082 /VolumetricFullConvolution.lua | |
parent | 948ac6a26cc6c2812e04718911bca9a4b641020e (diff) |
lazy init
Diffstat (limited to 'VolumetricFullConvolution.lua')
-rw-r--r-- | VolumetricFullConvolution.lua | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/VolumetricFullConvolution.lua b/VolumetricFullConvolution.lua index f9e1572..70784c1 100644 --- a/VolumetricFullConvolution.lua +++ b/VolumetricFullConvolution.lua @@ -27,9 +27,6 @@ function VolumetricFullConvolution:__init(nInputPlane, nOutputPlane, kT, kH, kW, self.bias = torch.Tensor(nOutputPlane) self.gradWeight = torch.Tensor(nOutputPlane, nInputPlane, kT, kH, kW) self.gradBias = torch.Tensor(nOutputPlane) - -- temporary buffers for unfolding (CUDA) - self.finput = torch.Tensor() - self.fgradInput = torch.Tensor() self:reset() end @@ -54,6 +51,8 @@ function VolumetricFullConvolution:reset(stdv) end function VolumetricFullConvolution:updateOutput(input) + self.finput = self.finput or input.new() + self.fgradInput = self.fgradInput or input.new() input.THNN.VolumetricFullConvolution_updateOutput( input:cdata(), self.output:cdata(), |