{"id":23539127,"url":"https://github.com/ruhaan838/anygrad","last_synced_at":"2025-11-03T20:04:53.265Z","repository":{"id":269725112,"uuid":"908263179","full_name":"Ruhaan838/AnyGrad","owner":"Ruhaan838","description":"A Tensor module that allows a deep learning framework to switch seamlessly between different engines.","archived":false,"fork":false,"pushed_at":"2025-04-18T05:02:15.000Z","size":395,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-15T02:13:50.303Z","etag":null,"topics":["ai","autograd","cpp20","deep-learning","engine","framework","machine-learning","python","python3","tensor-algebra"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ruhaan838.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2024-12-25T16:04:12.000Z","updated_at":"2025-03-15T17:37:43.000Z","dependencies_parsed_at":"2024-12-25T17:19:44.567Z","dependency_job_id":"88dad560-0d8d-42e4-ab00-e8042a0c873d","html_url":"https://github.com/Ruhaan838/AnyGrad","commit_stats":null,"previous_names":["ruhaan838/anygrad"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Ruhaan838/AnyGrad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ruhaan838%2FAnyGrad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ruhaan838%2FAnyGrad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ruhaan838%2FAnyGrad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ruhaan838%2FAnyGrad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ruhaan838","download_url":"https://codeload.github.com/Ruhaan838/AnyGrad/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ruhaan838%2FAnyGrad/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266334216,"owners_count":23912917,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ai","autograd","cpp20","deep-learning","engine","framework","machine-learning","python","python3","tensor-algebra"],"created_at":"2024-12-26T04:19:41.668Z","updated_at":"2025-11-03T20:04:52.360Z","avatar_url":"https://github.com/Ruhaan838.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \n# 🚂 AnyGrad: Flexible Engine for Tensor and Neural Network.\n\n[![Python Version](https://img.shields.io/badge/Python-3.10%2B-blue?logo=python)](https://www.python.org/)  [![PyPI Version](https://img.shields.io/pypi/v/anygrad?color=yellow\u0026logo=pypi)](https://pypi.org/project/anygrad/)  \n\n\n\u003c/div\u003e\n\n## Overview\nAnyGrad is a simple tensor library that makes it easy to perform forward and backward passes. It uses a high-performance C++ backend together with a user-friendly Python frontend. You can change the backend easily and simply.\n\n\u003e Note: currently version `0.0.1` does not support any engine. \nBut in the future, the integrations of engines like `numpy`, `pytorch` etc. will come and you can use them for anything from Tensor operation to high-level transformer training. \n\n## Installation\nInstall the library from PyPI:\n```bash\npip install anygrad\n```\n\nIf you'd like to work on the code:\n```bash\ngit clone https://github.com/Ruhaan838/AnyGrad.git\n./setup.sh\n```\n\n## Getting Started\n### Creating a Tensor\nCreate tensors by importing the library and instantiating `Tensor`. By default, gradients are not tracked unless you enable them:\n```python\nimport anygrad\n\n# A tensor that does not calculate gradients\na = anygrad.Tensor([1, 2, 3])  \n\n# A tensor with gradient tracking enabled\nb = anygrad.Tensor([2, 3, 4], requires_grad=True)  \n\n# A tensor with a specific data type (float64)\nc = anygrad.Tensor([2, 3, 4], dtype=anygrad.float64)\n```\n\u003e Other datatypes:\u003cbr\u003e\nanygrad.int32 \u003cbr\u003e\nanygrad.int64 \u003cbr\u003e\nanygrad.bool \u003cbr\u003e\n\n### Arithmetic Operations\n#### Element-wise Operations\nPerform calculations on tensors element by element:\n```python\nd = a + b         # addition\nd = a * d         # multiplication\nd = d / 10        # division\ne = d - 10        # subtraction\n```\n\n#### Matrix Multiplication\nYou can multiply matrices in two ways:\n```python\n# Using the @ operator:\na = anygrad.ones((1, 2, 3), requires_grad=True)\nb = anygrad.ones((2, 3, 4), requires_grad=True)\nc = a @ b         # tensor of shape (2, 2, 4)\n\n# Or using the function:\nc = anygrad.matmul(a, b)\n```\n\n### Gradient Calculation\nAnyGrad automatically computes gradients, which you can access after running the backward pass:\n```python\na = anygrad.Tensor([1, 2, 3], requires_grad=True)\nb = anygrad.Tensor([2, 3, 4], requires_grad=True)\nc = a * b \nresult = c.sum()\nresult.backward()\n\nprint(a.grad)\nprint(b.grad)\n```\n\n## Contributing\nContributions are welcome! Whether you want to improve performance or enhance the documentation, please open an issue or submit a pull request.\n\n## License\nThis project is licensed under the terms outlined in the [LICENSE](LICENSE) file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruhaan838%2Fanygrad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruhaan838%2Fanygrad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruhaan838%2Fanygrad/lists"}