Skip to content

Commit 1df3385

Browse files
authored
[OpenCL] Fix layout ImageFolder to NCHW bug (#7728)
1 parent b24a073 commit 1df3385

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lite/kernels/opencl/layout_image_compute.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -647,11 +647,11 @@ class LayoutComputeImageFolderToBufferChw
647647

648648
DDim x_image_shape;
649649
if (x_dims.size() > 2) {
650-
CLImageConverterFolder folder_converter;
651-
x_image_shape = folder_converter.InitImageDimInfoWith(x_dims);
652-
} else {
653650
CLImageConverterDefault default_converter;
654651
x_image_shape = default_converter.InitImageDimInfoWith(x_dims);
652+
} else {
653+
CLImageConverterFolder folder_converter;
654+
x_image_shape = folder_converter.InitImageDimInfoWith(x_dims);
655655
}
656656

657657
const cl::Buffer* y_data =
@@ -782,11 +782,11 @@ class LayoutComputeBufferChwToImageFolder
782782
auto y_dims = param.y->dims();
783783
DDim image_shape;
784784
if (y_dims.size() > 2) {
785-
CLImageConverterFolder folder_converter;
786-
image_shape = folder_converter.InitImageDimInfoWith(y_dims);
787-
} else {
788785
CLImageConverterDefault default_converter;
789786
image_shape = default_converter.InitImageDimInfoWith(y_dims);
787+
} else {
788+
CLImageConverterFolder folder_converter;
789+
image_shape = folder_converter.InitImageDimInfoWith(y_dims);
790790
}
791791
auto* y_data =
792792
MUTABLE_DATA_GPU(param.y, image_shape[0], image_shape[1], nullptr);

0 commit comments

Comments
 (0)