OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Rust Autograd

Rust Autograd is a Rust library for ndarray-backed tensors, differentiable operations, reverse-mode automatic differentiation and low-level neural-network training.

Independent OpenViST project profile, based on linked sources.

Rust Autograd — Reverse-mode automatic differentiation in Rust
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when machine-learning or numerical code needs tensor operations and automatic differentiation within a Rust project, or when assembling neural-network training code from low-level building blocks.

Who it is for

  • Rust developers implementing differentiable computations or gradient-based machine-learning code.
  • Developers building neural-network training examples with tensor computation graphs.

Documented uses

  • Define tensor operations and calculate gradients, including differentiating a gradient again.
  • Build low-level neural-network code with matrix multiplication, loss calculations and parameter gradients.
  • Follow the documented MNIST multilayer-perceptron pattern when designing a small classifier training example.
Before you choose

Requirements & limits

  • The library is written in Rust and its tensors are backed by ndarray.
  • The README describes gradients for scalar expressions, placeholder-fed evaluation, and second derivatives.
  • The MNIST MLP example shows weights, biases, matrix multiplication, sparse softmax cross-entropy and gradient construction; the feeder and Adam update lines are commented out.
  • For basic linear algebra, especially matrix multiplication, the README recommends considering the BLAS feature and lists Accelerate, Intel MKL and OpenBLAS choices.
  • The repository metadata identifies the license as MIT.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Compute a derivative with Rust Autograd

Build a scalar computation graph and evaluate a first or second derivative.

Before you start

  • Rust project with the autograd crate available as a dependency.

Steps

  1. Import autograd as ag and import ag::tensor_ops::*.

  2. Inside ag::run, create scalar placeholders with ctx.placeholder, then define the scalar expression using tensor operations.

  3. Use grad(&[output], &[input])[0] to construct a derivative.

  4. Evaluate the derivative with eval(ctx); when the derivative depends on an unfilled placeholder, feed it through ctx.evaluator().push(...).feed(...).run(). For a second derivative, apply grad to the first derivative.

Expected outcome

Evaluated scalar derivatives; the documented example computes values 3, 8, and 4 for derivatives of `2x² + 3y + 1` at the stated feed.

Guide limitations

  • The example feeds x with the scalar value 2 to evaluate dz/dx; derivatives requiring unfilled placeholders need input feeds.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
11 November 2026
Original website title
raskr/rust-autograd · Official homepage title · retained in its source language