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:
authorBoris Fomitchev <bfomitchev@nvidia.com>2015-10-15 04:23:47 +0300
committerBoris Fomitchev <bfomitchev@nvidia.com>2015-10-15 04:23:47 +0300
commit6d601d11b55e8ce18190b9ff02d27e046cbd52f7 (patch)
treec470d0938e4e85d79fd54f14e280e20978e9fa48 /SpatialSoftMax.lua
parentab763a99d1a7e04f329a117916d1ea4a798f7f1e (diff)
Natalias contiguity fix
Diffstat (limited to 'SpatialSoftMax.lua')
-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(),