Skip to main content

check_dtype

Function check_dtype 

Source
pub fn check_dtype(
    expected: KernelDType,
    actual: KernelDType,
) -> Result<(), StridedError>
Expand description

Check a descriptor dtype against a prepared operation.

§Examples

use strided_basic::{KernelDType, execution::check_dtype};
check_dtype(KernelDType::F64, KernelDType::F64).unwrap();
assert!(check_dtype(KernelDType::F64, KernelDType::F32).is_err());

§Errors

Returns DTypeMismatch when the tags differ.