# tensorplay.functional.can_cast Source: https://www.tensorplay.cn/docs/generated/tensorplay.functional.can_cast.html ```python tensorplay.functional.can_cast(from_, to) → bool ``` described in the type promotion documentation. Parameters: - from_ ([dtype](/docs/generated/tensorplay.DType.html#tensorplay.DType)) – The original [tensorplay.dtype](/docs/generated/tensorplay.DType.html#tensorplay.DType). - to ([dtype](/docs/generated/tensorplay.DType.html#tensorplay.DType)) – The target [tensorplay.dtype](/docs/generated/tensorplay.DType.html#tensorplay.DType). Example: ``` >>> tensorplay.can_cast(tensorplay.double, tensorplay.float) True >>> tensorplay.can_cast(tensorplay.float, tensorplay.int) False ```