Skip to content

Commit

Permalink
fix a bug in examples/simple/simple-backend (#1078)
Browse files Browse the repository at this point in the history
Co-authored-by: yangxiao <[email protected]>
  • Loading branch information
Yangxiaoz and yangxiao authored Feb 7, 2025
1 parent 08b5380 commit d633684
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/simple/simple-backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ int main(void) {
ggml_backend_tensor_get(result, out_data.data(), 0, ggml_nbytes(result));

// expected result:
// [ 60.00 110.00 54.00 29.00
// 55.00 90.00 126.00 28.00
// 50.00 54.00 42.00 64.00 ]
// [ 60.00 55.00 50.00 110.00
// 90.00 54.00 54.00 126.00
// 42.00 29.00 28.00 64.00 ]

printf("mul mat (%d x %d) (transposed result):\n[", (int) result->ne[0], (int) result->ne[1]);
for (int j = 0; j < result->ne[1] /* rows */; j++) {
Expand All @@ -201,7 +201,7 @@ int main(void) {
}

for (int i = 0; i < result->ne[0] /* cols */; i++) {
printf(" %.2f", out_data[i * result->ne[1] + j]);
printf(" %.2f", out_data[j * result->ne[0] + i]);
}
}
printf(" ]\n");
Expand Down

0 comments on commit d633684

Please sign in to comment.