TensorRT plugin input data format

I have Tensorflow model converting to TensorRT and upsample op needs to make a plugin.

https://www.dropbox.com/s/nxz1j8vh56uezh9/plugin.png?dl=0

CUDA code with a plugin is made as follows.

For example 1x3x3x2 (NHWC) tensor is upscaled to 1x12x12x2 (NHWC) tensor as follow.

https://www.dropbox.com/s/2yjohpl2y84ytml/input.png?dl=0
https://www.dropbox.com/s/zqbl3o7191hgjeb/output.png?dl=0

My CUDA code is expecting data in the format

10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27.

But output from CUDA looks like data is fed to plugin as

10,12,14,16,18,20,22,24,26,11,13,15,17,19,21,23,25,27.

How to solve the issue?