An open API service indexing awesome lists of open source software.

https://github.com/andreimoraru123/venus

Deep Learning Framework for C++23
https://github.com/andreimoraru123/venus

cpp23 deep-learning neural-networks ranges tensors

Last synced: 3 months ago
JSON representation

Deep Learning Framework for C++23

Awesome Lists containing this project

README

          

# Venus: Zero-Cost Tensors for Modern Deep Learning

### Demo:

```cpp
// demo/tensor_range.cpp

#include "core/tensor/tensor.hpp"
#include
#include

using namespace venus;

auto main() -> int {
auto tensor = Tensor(3, 3); // heap alloc 3x3 Tensor

std::ranges::iota(tensor, 1); // 1, 2, 3, 4, 5, 6, 7, 8, 9

auto pipeline =
tensor |
std::views::filter([](int x) { return x % 2 == 0; }) | // 2, 4, 6, 8
std::views::transform([](int x) { return x * x; }) | // 4, 16, 36, 64
std::views::take(2); // 4, 16

auto result = std::ranges::fold_left(pipeline, 0, std::plus{}); // 20
assert(result == 20);
}
```