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

github.com/soumith/cudnn.torch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SpatialSoftMax.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/SpatialSoftMax.lua b/SpatialSoftMax.lua
index 57470cf..f874cd3 100644
--- a/SpatialSoftMax.lua
+++ b/SpatialSoftMax.lua
@@ -68,7 +68,12 @@ function SpatialSoftMax:updateOutput(input)
end
function SpatialSoftMax:updateGradInput(input, gradOutput)
- assert(gradOutput:isContiguous());
+ if not gradOutput:isContiguous() then
+ self._gradOutput = self._gradOutput or gradOutput.new()
+ self._gradOutput:resizeAs(gradOutput):copy(gradOutput)
+ gradOutput = self._gradOutput
+ end
+
self:createIODescriptors(input)
errcheck('cudnnSoftmaxBackward',
cudnn.getHandle(),