Skip to content

Commit

Permalink
Cleaned up a test
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitsteiner committed Sep 18, 2015
1 parent c37ff5c commit f6e490b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions unsupported/test/cxx11_tensor_argmax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ static void test_argmax_dim()

tensor_argmax = tensor.argmax(dim);

VERIFY_IS_EQUAL(tensor_argmax.dimensions().TotalSize(),
size_t(2*3*5*7 / tensor.dimension(dim)));
VERIFY_IS_EQUAL(tensor_argmax.size(),
ptrdiff_t(2*3*5*7 / tensor.dimension(dim)));
for (ptrdiff_t n = 0; n < tensor_argmax.size(); ++n) {
// Expect max to be in the first index of the reduced dimension
VERIFY_IS_EQUAL(tensor_argmax.data()[n], 0);
Expand All @@ -208,7 +208,7 @@ static void test_argmax_dim()

VERIFY_IS_EQUAL(tensor_argmax.size(),
ptrdiff_t(2*3*5*7 / tensor.dimension(dim)));
for (ptrdiff_t n = 0; n < tensor_argmax.dimensions().TotalSize(); ++n) {
for (ptrdiff_t n = 0; n < tensor_argmax.size(); ++n) {
// Expect max to be in the last index of the reduced dimension
VERIFY_IS_EQUAL(tensor_argmax.data()[n], tensor.dimension(dim) - 1);
}
Expand Down Expand Up @@ -242,8 +242,8 @@ static void test_argmin_dim()

tensor_argmin = tensor.argmin(dim);

VERIFY_IS_EQUAL(tensor_argmin.dimensions().TotalSize(),
size_t(2*3*5*7 / tensor.dimension(dim)));
VERIFY_IS_EQUAL(tensor_argmin.size(),
ptrdiff_t(2*3*5*7 / tensor.dimension(dim)));
for (ptrdiff_t n = 0; n < tensor_argmin.size(); ++n) {
// Expect min to be in the first index of the reduced dimension
VERIFY_IS_EQUAL(tensor_argmin.data()[n], 0);
Expand All @@ -266,7 +266,7 @@ static void test_argmin_dim()

VERIFY_IS_EQUAL(tensor_argmin.size(),
ptrdiff_t(2*3*5*7 / tensor.dimension(dim)));
for (ptrdiff_t n = 0; n < tensor_argmin.dimensions().TotalSize(); ++n) {
for (ptrdiff_t n = 0; n < tensor_argmin.size(); ++n) {
// Expect min to be in the last index of the reduced dimension
VERIFY_IS_EQUAL(tensor_argmin.data()[n], tensor.dimension(dim) - 1);
}
Expand Down

0 comments on commit f6e490b

Please sign in to comment.