#operation #abandoned #tensor #addition #sigmoid

flashlight_tensor

tensor library focused around matrix operations, *not* abandoned

7 releases

Uses new Rust 2024

0.2.6 Apr 30, 2025
0.2.5 Apr 26, 2025

#304 in Math

Download history 306/week @ 2025-04-16 286/week @ 2025-04-23 186/week @ 2025-04-30

778 downloads per month
Used in flashlight

MIT/Apache

67KB
948 lines

flashlight_tensor

Tests Crates.io Docs.rs

Tensor library written in pure rust, designed mostly for matrix operations

Earlier I decided to abandon the project, but I guess, I still want to work on that project

project not related to similarly named flashlight. The name was coincidental and chosen independently.

Features

  • n-dimensional tensors
  • Element-wise operations
  • Scalar multiplication and addition
  • Tensor multiplication and addition
  • Matrix transformation
  • Dot product
  • ReLU and sigmoid
  • CPU only, with GPU support in plans

Instalation

[dependencies]
flashlight_tensor = "0.2.6"

Quick Start

use flashlight_tensor::prelude::*;

fn main(){
    //2 rows, 2 collumns, fill with 1.0
    let a: Tensor<f32> = Tensor::fill(1.0, &[2, 2]);
}

Documentation

Docs

all tensor operations in tensor category

Tests

Run tests with:
cargo test

G# means github version # of patch. You can treat that as alpha patch of next version. Versions G are avilable on github early, and those features will be released on cargo with next bigger patch. Not everything in G version is tested and working. You are using it at your own responsibility.

Patch notes

  • V0.2.4:
    • matrix_vec/col, now return a matrix, not vector
    • matrix_col/row_sum/prod, return a sum/product of all collumns/rows in matrix
  • V0.2.5
    • G1
      • mutable operations for iterative functions
    • G2
      • better file structure
  • V0.2.6
    • activation functions for neural network

Plans for 0.3.0

  • Gpu support using wgpu

No runtime deps