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:
authorSoumith Chintala <soumith@gmail.com>2016-12-01 20:05:50 +0300
committerGitHub <noreply@github.com>2016-12-01 20:05:50 +0300
commit05890b643148f4169302345dfa885547ad4d8ee5 (patch)
tree2e7e218c27c8920507417743c2b221ec791a945f /LookupTable.lua
parent8dff3df9676caae7fd87551ee2ac24626f4a0852 (diff)
parent2a64e82da91cddc4b791d6c0763c2a38f1320e25 (diff)
Merge pull request #1053 from gchanan/autoContigLua
Move make contiguous code from lua to C.
Diffstat (limited to 'LookupTable.lua')
-rw-r--r--LookupTable.lua8
1 files changed, 1 insertions, 7 deletions
diff --git a/LookupTable.lua b/LookupTable.lua
index 8ca7ddb..d454053 100644
--- a/LookupTable.lua
+++ b/LookupTable.lua
@@ -102,12 +102,6 @@ function LookupTable:accGradParameters(input, gradOutput, scale)
error("input must be a vector or matrix")
end
- if not gradOutput:isContiguous() then
- self._gradOutput = self._gradOutput or gradOutput.new()
- self._gradOutput:resizeAs(gradOutput):copy(gradOutput)
- gradOutput = self._gradOutput
- end
-
self.gradWeight.THNN.LookupTable_accGradParameters(
input:cdata(),
gradOutput:cdata(),
@@ -162,7 +156,7 @@ function LookupTable:type(type, tensorCache)
end
function LookupTable:clearState()
- nn.utils.clear(self, '_count', '_input', '_gradOutput')
+ nn.utils.clear(self, '_count', '_input')
return parent.clearState(self)
end