COOLJAPAN
← All posts

TenfloweRS 0.1.0 Released — Pure Rust TensorFlow, 12,949 Tests Passing

TenfloweRS is a pure-Rust alternative to TensorFlow, and this is its first stable release. It ships dual eager + graph execution, reverse-mode autodiff, 150+ research domains, and WGPU GPU acceleration — built on the SciRS2 and NumRS2 ecosystem, with no C++, CUDA-C, or Python runtime.

release tenflowers machine-learning deep-learning tensorflow rust neural-networks autograd

Deep learning without a C++ compiler, a CUDA toolkit, or a Python interpreter — just one Rust binary.

Today we released TenfloweRS 0.1.0 — a research-grade, pure-Rust deep-learning framework that gives you tensors, computation graphs, autodiff, training, and inference with the ergonomics of TensorFlow and none of its build pain.

No C. No C++. No CUDA-C. No Python. TensorFlow’s power has always come bundled with the libtensorflow + CUDA toolchain — a multi-gigabyte stack of compiled C++, vendor drivers, and a Python runtime you have to keep alive at inference time. TenfloweRS throws all of that out. The tensor engine, the graph runtime, the autodiff tape, the neural layers, and the GPU backend are all written in safe Rust. The result compiles to a single static binary (or WASM) you can ship anywhere.

Why TenfloweRS 0.1.0 matters

Anyone who has stood up a TensorFlow project knows the failure modes: a C++/CUDA build that fights your compiler, version-locked driver hell, a Python runtime that has to ride along into production, and the occasional native segfault that gives you a core dump instead of a stack trace. TenfloweRS is a clean break.

Technical Deep Dive: the six-crate workspace

TenfloweRS 0.1.0 is six workspace crates, layered so each one has a single clear job. The familiar TensorFlow concepts map onto Rust types you can reason about statically.

Graphs and sessions get the same treatment: tf.Graph becomes a Graph struct with clear ownership semantics, and tf.Session becomes a Session trait — so a graph is a value you own, not a global handle you hope is still alive.

Getting Started

Add the meta-crate:

cargo add tenflowers

A minimal end-to-end example — eager tensor math, a small feedforward classifier, and an optimizer ready for the training loop:

use tenflowers::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Eager tensor math
    let a = Tensor::<f32>::ones(&[2, 3]);
    let b = Tensor::<f32>::ones(&[3, 4]);
    let c = ops::matmul(&a, &b)?;
    println!("matmul shape: {:?}", c.shape());

    // A small feedforward classifier
    let model = Sequential::<f32>::new(vec![])
        .add(Box::new(Dense::new(784, 128, true).with_activation("relu".to_string())))
        .add(Box::new(Dense::new(128, 10, true).with_activation("softmax".to_string())));

    let input = Tensor::<f32>::zeros(&[32, 784]);
    let logits = model.forward(&input)?;
    println!("logits shape: {:?}", logits.shape());

    // Optimizer for the training loop
    let _optimizer = SGD::<f32>::new(0.01);
    Ok(())
}

For custom training, reach for GradientTape — the direct analogue of tf.GradientTape. You record the forward pass on the tape, then ask it for gradients with respect to your parameters, and feed those into the optimizer. It is the same mental model TensorFlow users already have, expressed in Rust types.

What’s inside

Tips

This is the foundation

TenfloweRS does not live alone. It is built on NumRS2 for arrays and the SciRS2 stack (scirs2-core, -autograd, -neural, -linalg, -numpy) for numerical primitives, on OptiRS for optimization, and it serializes through Oxicode. That shared base is why a first release can already ship 12,949 passing tests and roughly 641K lines of Rust across 1,453 source files — most of the hard numerical groundwork was already laid and battle-tested by its siblings. It joins ToRSh, our other pure-Rust deep-learning framework, in the COOLJAPAN family — different design centers, same goal of native, sovereign ML.

Repository: https://github.com/cool-japan/tenflowers

Star the repo if you want deep learning that builds in seconds, ships as one binary, and never asks for a CUDA toolkit. Pure Rust deep learning is here — fast, safe, and sovereign.

KitaSan at COOLJAPAN OÜ March 20, 2026

↑ Back to all posts