luminal 0.2.0

Deep learning at the speed of light.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use luminal::{nn::linear::Linear, prelude::*};

fn main() {
    // Create a new graph
    let mut cx = Graph::new();
    // Randomly initialize a linear layer with an input size of 4 and an output size of 5
    let model = Linear::<4, 5>::initialize(&mut cx);
    // Make an input tensor
    let a = cx.tensor::<R1<4>>().set(vec![1., 2., 3., 4.]);
    // Feed tensor through model
    let b = model.forward(a).retrieve();
    // Execute the graph
    cx.execute_debug();
    // Print the results
    println!("B: {:?}", b.data());
}