Skip to content

Commit d633684

Browse files
Yangxiaozyangxiao
and
yangxiao
authored
fix a bug in examples/simple/simple-backend (#1078)
Co-authored-by: yangxiao <[email protected]>
1 parent 08b5380 commit d633684

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/simple/simple-backend.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ int main(void) {
190190
ggml_backend_tensor_get(result, out_data.data(), 0, ggml_nbytes(result));
191191

192192
// expected result:
193-
// [ 60.00 110.00 54.00 29.00
194-
// 55.00 90.00 126.00 28.00
195-
// 50.00 54.00 42.00 64.00 ]
193+
// [ 60.00 55.00 50.00 110.00
194+
// 90.00 54.00 54.00 126.00
195+
// 42.00 29.00 28.00 64.00 ]
196196

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

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

0 commit comments

Comments
 (0)