# TensorLib

A deep learning tensor library written from scratch in pure C, with autograd, GPT-style transformer building blocks, and CPU-only SIMD-accelerated training with no external ML dependencies.

TensorLib is a from-scratch deep learning library implemented entirely in C. It provides N-dimensional float32 tensors with NumPy-style broadcasting, zero-copy strided views, and reference-counted storage, plus a dynamic reverse-mode autograd engine covering 24 differentiable operations.

On top of the tensor core it offers neural network modules such as Linear, Embedding, LayerNorm, Dropout, multi-head causal self-attention and a full GPT-style decoder, along with a cross-entropy loss, SGD and AdamW optimizers, and versioned checkpointing. Matrix multiplication uses an AVX2+FMA SIMD kernel, and the library has no Python, CUDA or third-party ML dependencies, running CPU-only.

Website: https://github.com/nisbenz/TensorLib
