Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/nn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'SpatialDilatedConvolution.lua')
-rw-r--r--SpatialDilatedConvolution.lua19
1 files changed, 0 insertions, 19 deletions
diff --git a/SpatialDilatedConvolution.lua b/SpatialDilatedConvolution.lua
index 0ae914e..a0590c7 100644
--- a/SpatialDilatedConvolution.lua
+++ b/SpatialDilatedConvolution.lua
@@ -8,26 +8,9 @@ function SpatialDilatedConvolution:__init(nInputPlane, nOutputPlane, kW, kH, dW,
self.dilationH = dilationH or 1
end
-local function makeContiguous(self, input, gradOutput)
- if not input:isContiguous() then
- self._input = self._input or input.new()
- self._input:resizeAs(input):copy(input)
- input = self._input
- end
- if gradOutput then
- if not gradOutput:isContiguous() then
- self._gradOutput = self._gradOutput or gradOutput.new()
- self._gradOutput:resizeAs(gradOutput):copy(gradOutput)
- gradOutput = self._gradOutput
- end
- end
- return input, gradOutput
-end
-
function SpatialDilatedConvolution:updateOutput(input)
self.finput = self.finput or self.weight.new()
self.fgradInput = self.fgradInput or self.weight.new()
- input = makeContiguous(self, input)
input.THNN.SpatialDilatedConvolution_updateOutput(
input:cdata(),
self.output:cdata(),
@@ -45,7 +28,6 @@ end
function SpatialDilatedConvolution:updateGradInput(input, gradOutput)
if self.gradInput then
- input, gradOutput = makeContiguous(self, input, gradOutput)
self.fgradInput = self.fgradInput or self.weight.new()
input.THNN.SpatialDilatedConvolution_updateGradInput(
input:cdata(),
@@ -64,7 +46,6 @@ end
function SpatialDilatedConvolution:accGradParameters(input, gradOutput, scale)
scale = scale or 1
- input, gradOutput = makeContiguous(self, input, gradOutput)
self.fgradInput = self.fgradInput or self.weight.new()
input.THNN.SpatialDilatedConvolution_accGradParameters(
input:cdata(),