Convert Variable[CUDAFloatType] to Variable[CUDALongType] in cpp

I want to convert torch.cuda.FloatTensor to torch.cuda.LongTensor in cpp. Any guideliness

If x is your tensor, then x = x.to(at::kLong) will work. Refer to the documentation.

1 Like

Thank you so much for the reference. That helps.