Skip to content

Commit

Permalink
fix(exercise): 20
Browse files Browse the repository at this point in the history
Signed-off-by: YdrMaster <[email protected]>
  • Loading branch information
YdrMaster committed Jul 21, 2024
1 parent f847c0a commit 8593931
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions exercises/20_class_template/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ int main(int argc, char **argv) {
auto t0 = Tensor4D(s0, d0);
auto t1 = Tensor4D(s1, d1);
t0 += t1;
for (unsigned int i = 0; i < sizeof(d0) / sizeof(int); i++) {
for (auto i = 0u; i < sizeof(d0) / sizeof(int); ++i) {
ASSERT(t0.data[i] == 7.f, "Every element of t0 should be 7 after adding t1 to it.");
}
}
Expand All @@ -102,8 +102,8 @@ int main(int argc, char **argv) {
auto t0 = Tensor4D(s0, d0);
auto t1 = Tensor4D(s1, d1);
t0 += t1;
for (unsigned int i = 0; i < sizeof(d0) / sizeof(int); i++) {
ASSERT(t0.data[i] == t0.data[i] + 1, "Every element of t0 should be incremented by 1 after adding t1 to it.");
for (auto i = 0u; i < sizeof(d0) / sizeof(int); ++i) {
ASSERT(t0.data[i] == d0[i] + 1, "Every element of t0 should be incremented by 1 after adding t1 to it.");
}
}
}

0 comments on commit 8593931

Please sign in to comment.