Changed the iterator to iterate over the same size tensors in the same order independent of memory layout.

This commit is contained in:
2023-09-13 14:12:02 +02:00
parent fd8a3d53e1
commit 15078171df
3 changed files with 40 additions and 24 deletions

View File

@@ -39,7 +39,9 @@ void tensoriter_test_scalar_get(void)
uint32_t contained = 0;
tensoriter_scalar iter = tensoriter_scalar_create(t);
do {
uint32_t value = (uint32_t) tensoriter_scalar_get(iter);
bool success;
uint32_t value = (uint32_t) tensoriter_scalar_get(iter, &success);
tensor_assert(success, "mute");
tensor_assert(((1 << (value - 1)) & contained) == 0, "mute");
contained |= 1 << (value - 1);
} while (tensoriter_scalar_next(iter));