Can_cast
Source:R/gen-namespace-docs.R
, R/gen-namespace-examples.R
, R/gen-namespace.R
torch_can_cast.Rd
Can_cast
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())
}
#> [1] FALSE