Skip to content

Commit 8409f02

Browse files
committed
Added DotProduct:type().
1 parent 2f834ce commit 8409f02

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

DotProduct.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,10 @@ function DotProduct:updateGradInput(input, gradOutput)
2727

2828
return self.gradInput
2929
end
30+
31+
function DotProduct:type(type)
32+
for i, tensor in ipairs(self.gradInput) do
33+
self.gradInput[i] = tensor:type(type)
34+
end
35+
return parent.type(self, type)
36+
end

0 commit comments

Comments
 (0)