powered by
Can_cast
torch_can_cast(from, to)
(dtype) The original torch_dtype.
torch_dtype
(dtype) The target torch_dtype.
Determines if a type conversion is allowed under PyTorch casting rules described in the type promotion documentation .
if (torch_is_installed()) { torch_can_cast(torch_double(), torch_float()) torch_can_cast(torch_float(), torch_int()) }
Run the code above in your browser using DataLab