forge-ml 0.1.0

A WebGPU-native machine learning runtime in Rust: train and run GPT-2 on any GPU wgpu reaches, with no CUDA and no Python
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// Element types supported by Forge 1.0: f32 compute, u32 indices.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum DType {
    F32,
    U32,
}

impl DType {
    pub fn size_bytes(self) -> usize {
        match self {
            DType::F32 | DType::U32 => 4,
        }
    }
}