diff options
author | Adam Lerer <alerer@fb.com> | 2017-02-22 01:13:06 +0300 |
---|---|---|
committer | Adam Lerer <alerer@fb.com> | 2017-02-28 21:30:31 +0300 |
commit | 49aaa5c89fdc7de87d0f8170e496d2945a0fc14a (patch) | |
tree | ba8b766dd96bc2b6c7d2ce80b91b850a27155970 /test | |
parent | d46ff6fdeb3f3284e49da4348927c1ce8d7e758e (diff) |
add TH_TENSOR_APPLY variants for optimized redux (+refactor)
Diffstat (limited to 'test')
-rw-r--r-- | test/test.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test.lua b/test/test.lua index 943aaa1..63db0bf 100644 --- a/test/test.lua +++ b/test/test.lua @@ -344,6 +344,11 @@ end function torchtest.max() -- torch.max([resval, resind,] x [,dim]) + -- TH_TENSOR_BASE + local m1 = torch.Tensor(8,2):fill(3):select(2, 1) + local resval, resind = torch.max(m1, 1) + mytester:assert(resind[1] == 1) + -- torch.max( x ) -- contiguous local m1 = torch.randn(100,100) @@ -480,6 +485,11 @@ function torchtest.min() -- torch.min([resval, resind,] x [,dim]) local res1val = torch.min(m1) mytester:assert(res1val ~= res1val, 'error in torch.min - NaNs') end + + -- TH_TENSOR_BASE + local m1 = torch.Tensor(4):fill(3) + local resval, resind = torch.min(m1, 1) + mytester:assert(resind[1] == 1) end function torchtest.cmax() |