{"id":15047724,"url":"https://github.com/saptakbhoumik/ouroboros","last_synced_at":"2026-01-25T17:04:04.805Z","repository":{"id":248271665,"uuid":"819536607","full_name":"SaptakBhoumik/Ouroboros","owner":"SaptakBhoumik","description":"Ouroboros is a C++ library to work with N dimentional tensors","archived":false,"fork":false,"pushed_at":"2024-09-01T14:35:48.000Z","size":181,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-12T16:20:54.484Z","etag":null,"topics":["cpp","cpp20","cpp20-library","ouroboros","tensor"],"latest_commit_sha":null,"homepage":"https://github.com/SaptakBhoumik/Ouroboros/wiki","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SaptakBhoumik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-24T17:49:50.000Z","updated_at":"2024-09-01T14:35:52.000Z","dependencies_parsed_at":"2024-07-13T16:22:33.154Z","dependency_job_id":null,"html_url":"https://github.com/SaptakBhoumik/Ouroboros","commit_stats":null,"previous_names":["saptakbhoumik/ouroboros"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaptakBhoumik%2FOuroboros","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaptakBhoumik%2FOuroboros/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaptakBhoumik%2FOuroboros/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaptakBhoumik%2FOuroboros/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SaptakBhoumik","download_url":"https://codeload.github.com/SaptakBhoumik/Ouroboros/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219855388,"owners_count":16556096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cpp20","cpp20-library","ouroboros","tensor"],"created_at":"2024-09-24T21:03:34.934Z","updated_at":"2026-01-25T17:04:04.797Z","avatar_url":"https://github.com/SaptakBhoumik.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ouroboros\n\nOuroboros is a C++ library to work with N dimentional tensors\n\n## Why?\n\nWell 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\n\n## Goals\n\n- Make it easy to use\n- Give the bare minimum features so that it can be easily extended(with minimal code) to meet that users need\n\n## Example usage\n\n```cpp\n#include \u003couroboros/tensor.hpp\u003e\n#include \u003ccmath\u003e\nint main(){\n    Ouroboros::Tensor\u003cdouble\u003e t1({2,3},1.0);\n    std::cout\u003c\u003c\"t1:\\n\"\u003c\u003ct1\u003c\u003c\"\\n\";\n    Ouroboros::Tensor\u003cdouble\u003e t2({3,2},2.0);\n    std::cout\u003c\u003c\"t2:\\n\"\u003c\u003ct2\u003c\u003c\"\\n\";\n\n    auto func=[](double x,double y)-\u003edouble{\n        return x*y;\n    };\n    Ouroboros::Tensor t3=Ouroboros::outer\u003cfunc\u003e(t1,t2);//Outer product of 2 tensors\n    std::cout\u003c\u003c\"t3:\\n\"\u003c\u003ct3\u003c\u003c\"\\n\";\n\n    auto sin=[](double x)-\u003edouble{\n        return std::sin(x);\n    };\n    t3=Ouroboros::transform\u003csin\u003e(t3);//Apply sin to all elements of t3\n    std::cout\u003c\u003c\"sin(t3):\\n\"\u003c\u003ct3\u003c\u003c\"\\n\";\n\n    std::cout\u003c\u003c\"t1+t2:\\n\"\u003c\u003ct1+t2\u003c\u003c\"\\n\";//Element wise addition\n    std::cout\u003c\u003c\"matmul(t1,t2):\\n\"\u003c\u003cOuroboros::matmul(t1,t2)\u003c\u003c\"\\n\";//Matrix multiplication\n\n\n    //There's a lot more you can do with tensors, check the documentation for more information\n}\n```\n## Installation Guide\nRun the following commands in your terminal\n```bash\ngit clone https://github.com/SaptakBhoumik/Ouroboros.git\ncd Ouroboros\nmeson --buildtype=release dist\ncd dist\nninja\nninja install #Use sudo if required\n```\n\n# TODO:Include how to compile with your project. And include the dependencies\n\n## Documentation\n\nFor comprehensive documentation of all public APIs, including detailed examples and NumPy equivalents, see [doc/DOC.MD](doc/DOC.MD).\n\nThe documentation includes:\n- Complete API reference for Shape and Tensor classes\n- Iterator classes (NDRange, IdxIterator, IdxIterator2)\n- All operators (bitwise, arithmetic, comparison, logical)\n- Utility functions (transform, reduce, accumulate, outer, concat, transpose, flip, broadcast)\n- NumPy-style examples showing equivalent operations for users familiar with NumPy\n\n```cpp\n// Quick comparison with NumPy:\n// NumPy: arr = np.ones((2, 3))\nOuroboros::Tensor\u003cdouble\u003e t({2, 3}, 1.0);\n\n// NumPy: arr2 = arr + 5\nauto t2 = t + 5.0;\n\n// NumPy: result = np.matmul(a, b)\nauto result = Ouroboros::matmul(t1, t2);\n\n// NumPy: transformed = np.sin(arr)\nauto sin_func = [](double x) { return std::sin(x); };\nauto transformed = Ouroboros::transform\u003csin_func\u003e(t)\n```\n\nMore examples can be found [HERE](https://github.com/SaptakBhoumik/Ouroboros/tree/master/example) \n\n\n## Future TODOs\n\n- Support block wise opperations like conv,block reduction etc\n- Better support for tensor slices and easier function to create function\n- Support GPU\n- Create a logo\n\n## Have questions?\n\nCool, you can contact me via mail.\nEmail: saptakbhoumik.acad@gmail.com\n\n## License\nThe Ouroboros library is licensed under the [Mozilla Public License](https://github.com/SaptakBhoumik/Ouroboros/blob/master/LICENSE), which is attached in this repository\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaptakbhoumik%2Fouroboros","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaptakbhoumik%2Fouroboros","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaptakbhoumik%2Fouroboros/lists"}