torch_can_cast {torch} | R Documentation |
Can_cast
Description
Can_cast
Usage
torch_can_cast(from_, to)
Arguments
from_ |
(dtype) The original |
to |
(dtype) The target |
can_cast(from, to) -> bool
Determines if a type conversion is allowed under PyTorch casting rules described in the type promotion documentation .
Examples
if (torch_is_installed()) {
torch_can_cast(torch_double(), torch_float())
torch_can_cast(torch_float(), torch_int())
}
[Package torch version 0.15.1 Index]