@Nathan_Wood
Correct me if I am wrong.
So after
auto a = x_gpu.slice(0, 0, 8)./* interpret as /(torch::kFloat16);
auto b = x_gpu.slice(0, 8, 16)./ interpret as */(torch::kFloat32);
what you want to see is that a is a tensor that has four float16 items and b has two float32 items, and they should point to the same memory location as x_gpu, correct?
If so, I think you have to implement your own code to treat a tensor as different data types (still passing byte type tensor and pass some meta when launch your gpu kernel code?). A tensor can only have one data type. And if you do to() to convert a tensor to another data type, this will be a copy.