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:
authorIvo Danihelka <ivo@danihelka.net>2014-03-12 14:18:59 +0400
committerIvo Danihelka <ivo@danihelka.net>2014-03-12 14:18:59 +0400
commit8409f02c040035860860209021f516de7972ea88 (patch)
tree8b6c7dbdaf3d7f33afef66f47101e5b196d4e37e /DotProduct.lua
parent2f834ce5a23ace20b0883a60227a21f28e8b6aca (diff)
Added DotProduct:type().
Diffstat (limited to 'DotProduct.lua')
-rw-r--r--DotProduct.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/DotProduct.lua b/DotProduct.lua
index bc8e854..7f7b524 100644
--- a/DotProduct.lua
+++ b/DotProduct.lua
@@ -27,3 +27,10 @@ function DotProduct:updateGradInput(input, gradOutput)
return self.gradInput
end
+
+function DotProduct:type(type)
+ for i, tensor in ipairs(self.gradInput) do
+ self.gradInput[i] = tensor:type(type)
+ end
+ return parent.type(self, type)
+end