TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 229 subscribers
Post #24748 19
Feedback wanted: C++20 tensor library with NumPy-inspired API

I've been working on a tensor library and would appreciate feedback from people who actually know C++ well.

**What it is:** A tensor library targeting the NumPy/PyTorch mental model - shape broadcasting, views via strides, operator overloading, etc.

**Technical choices I made:**

* C++20 (concepts, ranges where appropriate)
* xsimd for portable SIMD across architectures
* Variant-based dtype system instead of templates everywhere
* Copy-on-write with shared\_ptr storage

**Things I'm uncertain about:**

* Is the Operation registry pattern overkill? It dispatches by OpType enum + Device
* Using std::variant for axis elements in einops parsing - should this be inheritance?
* The BLAS backend abstraction feels clunky
* Does Axiom actually seem useful?
* What features might make you use it over something like Eigen?

It started because I wanted NumPy's API but needed to deploy on edge devices without Python. Ended up going deeper than expected (28k LOC+) into BLAS backends, memory views, and GPU kernels.

Github: [https://github.com/frikallo/axiom](https://github.com/frikallo/axiom)

Would so appreciate feedback from anyone interested! Happy to answer questions about the implementation.

https://redd.it/1qu3acu
@r_cpp
GitHub GitHub - Frikallo/axiom: High-performance C++ tensor library with NumPy/PyTorch-like API High-performance C++ tensor library with NumPy/PyTorch-like API - Frikallo/axiom
More from @r_cpp
  1. Oct 7, 2026Escaping `CreateProcess()` arguments on Windows https://holyblackcat.github.io/blog/2026/0…
  2. Oct 7, 2026flat_map internals https://quantdev.blog/posts/flat-map-internals/index.html https://redd.…
  3. Oct 7, 2026New C++ Conference Videos Released This Month - September 2026 C++Now 2026-08-31 - 2026-09…
  4. Oct 7, 2026Jean Frantz René: C++ Memory safety for safety-critical and non-safety critical applicatio…
  5. Oct 7, 2026Full Meeting C++ 2026 program released https://meetingcpp.com/mcpp/schedule/#2026 https://…
  6. Oct 7, 2026Qt moc now can handle basic C++ modules (Qt 6.12) https://codereview.qt-project.org/c/qt/q…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →