https://github.com/saptakbhoumik/ouroboros
Ouroboros is a C++ library to work with N dimentional tensors
https://github.com/saptakbhoumik/ouroboros
cpp cpp20 cpp20-library ouroboros tensor
Last synced: 4 months ago
JSON representation
Ouroboros is a C++ library to work with N dimentional tensors
- Host: GitHub
- URL: https://github.com/saptakbhoumik/ouroboros
- Owner: SaptakBhoumik
- License: mpl-2.0
- Created: 2024-06-24T17:49:50.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-01T14:35:48.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T16:20:54.484Z (over 1 year ago)
- Topics: cpp, cpp20, cpp20-library, ouroboros, tensor
- Language: C++
- Homepage: https://github.com/SaptakBhoumik/Ouroboros/wiki
- Size: 177 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ouroboros
Ouroboros is a C++ library to work with N dimentional tensors
## Why?
Well the main reason that this library exists is for personal use in my other projects. The only reason that it is public is because some people may find it useful
## Goals
- Make it easy to use
- Give the bare minimum features so that it can be easily extended(with minimal code) to meet that users need
## Example usage
```cpp
#include
#include
int main(){
Ouroboros::Tensor t1({2,3},1.0);
std::cout<<"t1:\n"< t2({3,2},2.0);
std::cout<<"t2:\n"<double{
return x*y;
};
Ouroboros::Tensor t3=Ouroboros::outer(t1,t2);//Outer product of 2 tensors
std::cout<<"t3:\n"<double{
return std::sin(x);
};
t3=Ouroboros::transform(t3);//Apply sin to all elements of t3
std::cout<<"sin(t3):\n"< t({2, 3}, 1.0);
// NumPy: arr2 = arr + 5
auto t2 = t + 5.0;
// NumPy: result = np.matmul(a, b)
auto result = Ouroboros::matmul(t1, t2);
// NumPy: transformed = np.sin(arr)
auto sin_func = [](double x) { return std::sin(x); };
auto transformed = Ouroboros::transform(t)
```
More examples can be found [HERE](https://github.com/SaptakBhoumik/Ouroboros/tree/master/example)
## Future TODOs
- Support block wise opperations like conv,block reduction etc
- Better support for tensor slices and easier function to create function
- Support GPU
- Create a logo
## Have questions?
Cool, you can contact me via mail.
Email: saptakbhoumik.acad@gmail.com
## License
The Ouroboros library is licensed under the [Mozilla Public License](https://github.com/SaptakBhoumik/Ouroboros/blob/master/LICENSE), which is attached in this repository