So this doesn’t answer your question, but it’ll likely solve your problem:
Always work with torch::tensor. If you create new tensors, pass the .options() of an existing tensor to make it look right to everything else.
Then you should not encounter the need to convert tensors.
The only place where you currently need to care about subtle things are autograd::Functions, where you use Variables, but that will go away eventually.
Best regards
Thomas