diff options
author | Ivo Danihelka <ivo@danihelka.net> | 2014-03-12 14:18:59 +0400 |
---|---|---|
committer | Ivo Danihelka <ivo@danihelka.net> | 2014-03-12 14:18:59 +0400 |
commit | 8409f02c040035860860209021f516de7972ea88 (patch) | |
tree | 8b6c7dbdaf3d7f33afef66f47101e5b196d4e37e /DotProduct.lua | |
parent | 2f834ce5a23ace20b0883a60227a21f28e8b6aca (diff) |
Added DotProduct:type().
Diffstat (limited to 'DotProduct.lua')
-rw-r--r-- | DotProduct.lua | 7 |
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 |