https://github.com/oniani/tensor
A fast, zero-dependency tensor library in under 1000 lines of C++
https://github.com/oniani/tensor
cpp dl ml tensor
Last synced: 7 months ago
JSON representation
A fast, zero-dependency tensor library in under 1000 lines of C++
- Host: GitHub
- URL: https://github.com/oniani/tensor
- Owner: oniani
- License: mit
- Created: 2022-02-21T06:29:08.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-05T14:12:35.000Z (about 3 years ago)
- Last Synced: 2025-03-02T10:08:12.711Z (7 months ago)
- Topics: cpp, dl, ml, tensor
- Language: C++
- Homepage:
- Size: 180 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tensor
A fast, zero-dependency tensor library in under 1000 lines of C++.
## API
```cpp
#include "tensor.hpp"using namespace type;
int main() {
tensor2 t{{0, 1}, {2, 3}, {4, 5}};
t.square().print();
}
```## Testing
```console
$ mkdir build
$ cd build
$ cmake -DCOMPILER=clang -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=VCPKG_TOOLCHAIN_FILE ..
$ cmake --build .
```## References
- [Tensor][tensor]
## License
[MIT License][license]
[tensor]: https://en.wikipedia.org/wiki/Tensor
[license]: LICENSE