Hi,
i have a question regarding the tensor type conversion.
I have a tensor x, which requires_grad, and it is computed from the leaf tensor, which is created by me.
For some reason, i need the tensor x in type of long. So i applied x = x.long(). However, the resulting x doesn’t has requires_grad=True.
I wonder how i can propagate the requires_grad when i want to convert the tensor to type of long .
Appreciate for your help!