
Last chance! 50% off unlimited learning
Sale ends in
Can_cast
torch_can_cast(from, to)
(dtype) The original torch_dtype
.
(dtype) The target torch_dtype
.
Determines if a type conversion is allowed under PyTorch casting rules described in the type promotion documentation .
# NOT RUN {
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