Incorrect transpose results
KnightJun opened this issue · comments
KnightJun commented
This is a tensor with shape [2, 2, 1, 1], use transpose by perm [0, 2, 3, 1], it shoul not change the data. But from the results of my tests, by the partial loss of data.
Here is my test cases.
// windows / msvc / the code clone on May 5th.
float inData[4] = {1,2,3,4};
float outData[4] = {0};
size_t perm[4] = {0, 2, 3, 1};
size_t in_shape[4] = {2, 2, 1, 1};
int inDim = 4;
auto status = xnn_create_transpose_nd_x32(0, &transpose_opt);
xnn_setup_transpose_nd_x32(transpose_opt, inData, outData,
inDim, in_shape, perm, mThreadPool);
xnn_run_operator(transpose_opt, mThreadPool);
printf("outData:%f, %f, %f, %f\n", outData[0], outData[1], outData[2], outData[3]);
// outData:1.000000, 2.000000, 0.000000, 0.000000
outData should be {1, 2, 3, 4}, by actually outputs {1, 2, 0, 0}.