latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay.functional.can_cast
- tensorplay.functional.can_cast(from_, to) bool[source]
described in the type promotion documentation.
- Parameters:
from_ (dtype) – The original
tensorplay.dtype.to (dtype) – The target
tensorplay.dtype.
Example:
>>> tensorplay.can_cast(tensorplay.double, tensorplay.float) True >>> tensorplay.can_cast(tensorplay.float, tensorplay.int) False
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

