tensorgraph_sys/zero.rs
1/// This trait signifies that `[0; size_of::<T>]` is transmutable
2/// to a valid `T` safely, and that `T` fits some concept of 'zero'.
3///
4/// # Safety
5/// The set of zero bytes the size of Self should be a valid value
6pub unsafe trait Zero: Copy {}
7
8// at the moment, we only support floats in our tensor operations,
9// so let's only define those to minimize our code
10unsafe impl Zero for f32 {}
11unsafe impl Zero for f64 {}