Skip to content

Commit 8593931

Browse files
committed
fix(exercise): 20
Signed-off-by: YdrMaster <[email protected]>
1 parent f847c0a commit 8593931

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

exercises/20_class_template/main.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ int main(int argc, char **argv) {
8080
auto t0 = Tensor4D(s0, d0);
8181
auto t1 = Tensor4D(s1, d1);
8282
t0 += t1;
83-
for (unsigned int i = 0; i < sizeof(d0) / sizeof(int); i++) {
83+
for (auto i = 0u; i < sizeof(d0) / sizeof(int); ++i) {
8484
ASSERT(t0.data[i] == 7.f, "Every element of t0 should be 7 after adding t1 to it.");
8585
}
8686
}
@@ -102,8 +102,8 @@ int main(int argc, char **argv) {
102102
auto t0 = Tensor4D(s0, d0);
103103
auto t1 = Tensor4D(s1, d1);
104104
t0 += t1;
105-
for (unsigned int i = 0; i < sizeof(d0) / sizeof(int); i++) {
106-
ASSERT(t0.data[i] == t0.data[i] + 1, "Every element of t0 should be incremented by 1 after adding t1 to it.");
105+
for (auto i = 0u; i < sizeof(d0) / sizeof(int); ++i) {
106+
ASSERT(t0.data[i] == d0[i] + 1, "Every element of t0 should be incremented by 1 after adding t1 to it.");
107107
}
108108
}
109109
}

0 commit comments

Comments
 (0)