numr 0.16.0

Numerical computing and tensor library for Rust, in the role of NumPy: n-dimensional arrays, linear algebra, FFT, statistics and autograd on CPU, CUDA and WebGPU
Documentation
1
2
3
4
5
6
7
use crate::runtime::cpu::CpuRuntime;
use crate::tensor::Tensor;

/// Raw bit pattern of every element — no tolerance, no rounding.
pub(super) fn bits(tensor: &Tensor<CpuRuntime>) -> Vec<u32> {
    tensor.to_vec::<f32>().iter().map(|v| v.to_bits()).collect()
}