mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
Fixed a compilation warning
This commit is contained in:
parent
98f8f0db9a
commit
05f2f94f2b
@ -186,7 +186,7 @@ static void test_argmax_dim()
|
|||||||
|
|
||||||
VERIFY_IS_EQUAL(tensor_argmax.dimensions().TotalSize(),
|
VERIFY_IS_EQUAL(tensor_argmax.dimensions().TotalSize(),
|
||||||
size_t(2*3*5*7 / tensor.dimension(dim)));
|
size_t(2*3*5*7 / tensor.dimension(dim)));
|
||||||
for (size_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 first index of the reduced dimension
|
// Expect max to be in the first index of the reduced dimension
|
||||||
VERIFY_IS_EQUAL(tensor_argmax.data()[n], 0);
|
VERIFY_IS_EQUAL(tensor_argmax.data()[n], 0);
|
||||||
}
|
}
|
||||||
@ -206,8 +206,8 @@ static void test_argmax_dim()
|
|||||||
|
|
||||||
tensor_argmax = tensor.argmax(dim);
|
tensor_argmax = tensor.argmax(dim);
|
||||||
|
|
||||||
VERIFY_IS_EQUAL(tensor_argmax.dimensions().TotalSize(),
|
VERIFY_IS_EQUAL(tensor_argmax.size(),
|
||||||
size_t(2*3*5*7 / tensor.dimension(dim)));
|
ptrdiff_t(2*3*5*7 / tensor.dimension(dim)));
|
||||||
for (size_t n = 0; n < tensor_argmax.dimensions().TotalSize(); ++n) {
|
for (size_t n = 0; n < tensor_argmax.dimensions().TotalSize(); ++n) {
|
||||||
// Expect max to be in the last index of the reduced dimension
|
// Expect max to be in the last index of the reduced dimension
|
||||||
VERIFY_IS_EQUAL(tensor_argmax.data()[n], tensor.dimension(dim) - 1);
|
VERIFY_IS_EQUAL(tensor_argmax.data()[n], tensor.dimension(dim) - 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user