From: jijoong.moon Date: Mon, 8 Oct 2018 04:54:03 +0000 (+0900) Subject: [Transform] Fix transpose X-Git-Tag: v0.0.2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=60ded5be3a11cc8dc97314ea3f11a87afa77ee72;p=platform%2Fupstream%2Fnnstreamer.git [Transform] Fix transpose There was wrong tensro and C array index. Batch should be last index. Before this patch, the batch is the first index of C array or Tensor. **Self evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: jijoong.moon --- diff --git a/gst/tensor_transform/tensor_transform.c b/gst/tensor_transform/tensor_transform.c index df179a3..68df339 100644 --- a/gst/tensor_transform/tensor_transform.c +++ b/gst/tensor_transform/tensor_transform.c @@ -725,27 +725,29 @@ gst_tensor_transform_transpose (GstTensor_Transform * filter, return GST_FLOW_OK; } - indexI = filter->data_transpose.trans_order[1]; - indexJ = filter->data_transpose.trans_order[2]; - SL = fromDim[0], SI = fromDim[1], SJ = fromDim[2], SK = fromDim[3]; + indexI = filter->data_transpose.trans_order[0]; + indexJ = filter->data_transpose.trans_order[1]; + SL = fromDim[3], SI = fromDim[0], SJ = fromDim[1], SK = fromDim[2]; + + g_assert (filter->data_transpose.trans_order[3] == 3); switch (indexI) { - case 1: - if (indexJ == 2) { + case 0: + if (indexJ == 1) { transposeloop (l, i, j, k, SL, SI, SJ, SK, type_size); } else { transposeloop (l, i, k, j, SL, SI, SK, SJ, type_size); } break; - case 2: - if (indexJ == 1) { + case 1: + if (indexJ == 0) { transposeloop (l, j, i, k, SL, SJ, SI, SK, type_size); } else { transposeloop (l, j, k, i, SL, SJ, SK, SI, type_size); } break; - case 3: - if (indexJ == 1) { + case 2: + if (indexJ == 0) { transposeloop (l, k, i, j, SL, SK, SI, SJ, type_size); } else { transposeloop (l, k, j, i, SL, SK, SJ, SI, type_size);