PrimitiveML — Minimal tensor runtime & inference framework in C

PrimitiveML is a minimalist tensor library and inference framework written in C, inspired by PyTorch. It provides a low-level tensor runtime and a modular layer system (Module/Linear/Embedding) with forward()-style calls similar to PyTorch. The repository includes an example of running a small character-based GPT-2 model exported from PyTorch (see `nanogpt).

Features

  • Low-level tensor runtime with dynamic shapes, dtypes and strides.
  • Tensor ops: reshape, transpose, unsqueeze.
  • Element-wise ops with automatic broadcasting, reductions and matrix multiplication.
  • Basic activations: ReLU, Sigmoid, Softmax.
  • Modular API: Module, Linear, Embedding with forward() semantics.
  • Demo: infer…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help