Given a 1-d array in python labelled array, I can convert the array into a tensor using the following code
tensor = torch.FloatTensor(array) # array with normalised pixel values
tensor = torch.reshape(tensor, (3, 320, 320))
model([tensor]) # run model inference

How would I convert the 1-d array into a tensor in c++ with (C,H,W) dims given that I have a pointer to the base array address ?
P.S
I have tried at::Tensor tensor = torch::from_blob(array, { 3, input_width, input_height }, at::kFloat); however I believe the tensor output is different from that in python because the model inference in c++ shows differently.