Skip to content

Commit 4966d12

Browse files
committed
Add :cudaHalf() :cudaDouble() to Criterion.
1 parent 57114b9 commit 4966d12

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Criterion.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ function Criterion:cuda()
4949
return self:type('torch.CudaTensor')
5050
end
5151

52+
function Criterion:cudaHalf()
53+
return self:type('torch.CudaHalfTensor')
54+
end
55+
56+
function Criterion:cudaDouble()
57+
return self:type('torch.CudaDoubleTensor')
58+
end
59+
5260
function Criterion:__call__(input, target)
5361
self.output = self:forward(input, target)
5462
self.gradInput = self:backward(input, target)

0 commit comments

Comments
 (0)