Array ordering for Tensor creation

I want to create a at::Tensor from an flat array of floats. Let’s say I want to flat a multidimensional array with size (32, 3, 28, 28) to a flat array, and then use torch::from_blob

Should I use row-major order flattening, or column-major ordering?

float data[32*3*28*28];
// fill data somehow... row-major or column-major falttening...
at::Tennsor tensor_data = torch::from_blob((float*)data, {32, 3, 28, 28});

Did you ever figure this out?
I am trying to convert an RGB8 image to import as a tensor and cannot figure out if i should swap rows and columns.

More precisely.
I have a PNG of width 450 and height 400
In Python I do

with open('test.png', "rb") as image_file:
    image =
    image = image.convert("RGB")
data_transforms = transforms.Compose([transforms.ToTensor()])
image = data_transforms(image)
image = image.unsqueeze(0)

which give me a tensor of size torch.Size([1, 3, 400, 450]) (BxCxHxW)

but i don’t know how to do this properly in ios.