Convert tensor values (and gradients) to a different dtype.
Parameters:
-
dtype
(str)
–
Target dtype string (e.g. "float64").
-
inplace
(bool, default:
True
)
–
Modify this tensor in-place if True, else return a new tensor.
Returns:
-
'Tensor' | None
–
New Tensor if inplace=False, else None.