diff options
author | Trevor Killeen <killeentm@gmail.com> | 2016-11-08 19:11:39 +0300 |
---|---|---|
committer | Trevor Killeen <killeentm@gmail.com> | 2016-11-12 00:22:59 +0300 |
commit | cb3eb45848cf445b36f95c13161ff1c7e3e545f5 (patch) | |
tree | 3300c0d047535bddb14392489f4e2e7ede1d78bc /test | |
parent | 507fbe3d25497909aad66a9d384a69974a9bb041 (diff) |
[cutorch rand2gen] move cauchy to generic
Diffstat (limited to 'test')
-rw-r--r-- | test/test.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/test.lua b/test/test.lua index 8319971..f75c628 100644 --- a/test/test.lua +++ b/test/test.lua @@ -2620,9 +2620,12 @@ function test.cauchy() local median, sigma = torch.uniform(), torch.uniform() local t = torch.CudaTensor(sz1, sz2) - t:cauchy(median, sigma) - local u = ((t:float() - median) / sigma):atan() / math.pi + 0.5 - checkIfUniformlyDistributed(u, 0, 1) + for _, typename in ipairs(float_typenames) do + local x = t:type(t2cpu[typename]) + x:cauchy(median, sigma) + local u = ((x:float() - median) / sigma):atan() / math.pi + 0.5 + checkIfUniformlyDistributed(u, 0, 1) + end checkMultiDevice(t, 'cauchy', median, sigma) end |