Gradients tracking in case of integer data type. #1106
-
I have intialized a random tensor of int32 type and trying to set the requires_grad=True like this: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, you are correct. Calculating gradients relies on calculating changes even if that in extremely small during backpropagation. In case of integer, it is just discrete meaning there might be no huge jump from going to But in case of floating values as you said its continuous, even infinitely small changes in its input helps during backprop thats whyy gradient calculation is limited to float and complex types. |
Beta Was this translation helpful? Give feedback.
Yes, you are correct. Calculating gradients relies on calculating changes even if that in extremely small during backpropagation.
In case of integer, it is just discrete meaning there might be no huge jump from going to$1$ to $2$ and huge jump from going to $1$ to $10$ . Such sudden changes in jump results to non-smooth and non-converging behaviour.
But in case of floating values as you said its continuous, even infinitely small changes in its input helps during backprop thats whyy gradient calculation is limited to float and complex types.