1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! # briny_ai
//!
//! This crate provides a fast, minimal, and modular deep learning backend
//! built in Rust. It features basic tensor operations, automatic differentiation,
//! and support for CPU acceleration via Rayon and AVX2 SIMD. GPU support via WGPU
//! is optional and designed for portability across Intel, AMD, and NVIDIA hardware.
//!
//! ## Features
//!
//! - **Tensors**: N-dimensional arrays with shape tracking and gradient support
//! - **Autograd**: Functional-style forward and backward passes
//! - **Operators**: Efficient implementations of matrix multiplication, ReLU,
//! mean squared error, and stochastic gradient descent
//! - **Parallelism**: Leveraging `rayon` for CPU-side data parallelism
//! - **SIMD**: Optional AVX2 SIMD acceleration for key operators
//! - **GPU Acceleration**: Optional `wgpu`-powered compute shaders for matrix ops
//!
//! ## Features
//!
//! Enable with Cargo features:
//!
//! - `simd` — Enables AVX2 SIMD acceleration on supported x86_64 targets
//! - `wgpu` — Enables GPU compute shaders via WGPU
//!
//! ## Safety Notes
//!
//! - SIMD operations are gated behind feature flags and use `unsafe` internally.
//! - GPU support assumes buffers are correctly sized and aligned — validated at runtime.