# nptorch
A lightweight PyTorch clone - deep learning library built using **NumPy** (for CPU) and **CuPy** (for GPU). Ideal for understanding the core concepts of deep learning, backpropagation, automatic differentiation, and tensor operations in a minimalistic, easy-to-follow implementation. May be practically useful in scenarios where the library's small size and low dependency requirements are advantageous.
## Install nptorch using pip:
```bash
pip install nptorch
## Getting Started
```python
import nptorch as nt
# Create tensors
x = nt.tensor([[1.0, 2], [3, 4]], requires_grad=True)
y = nt.tensor([[5.0, 6], [7, 8]], requires_grad=True)
# Perform operations
z = x + y
w = z.mean()
w.backward()
# Print results
print("z:", z)
print("x.grad:", x.grad)
print("y.grad:", y.grad)
```
z: tensor([[ 6. 8.]
[10. 12.]], float32, grad_fn=<'Add' at 0x722942528260>)
x.grad: tensor([[0.25 0.25]
[0.25 0.25]], float32)
y.grad: tensor([[0.25 0.25]
[0.25 0.25]], float32)
```python
```
Raw data
{
"_id": null,
"home_page": null,
"name": "nptorch",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "PyTorch, NumPy, Automatic Differentiation, Back Propagation, Deep Learning, Neural Networks, CuPy, Auto Grad",
"author": null,
"author_email": "Bhawik Jani <bhawikjani1@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/06/6d/e27a6c4a74819fd6c403077f3b461f3be319f2f7b571f2867a6fe5e31fbd/nptorch-0.0.2.tar.gz",
"platform": null,
"description": "# nptorch\nA lightweight PyTorch clone - deep learning library built using **NumPy** (for CPU) and **CuPy** (for GPU). Ideal for understanding the core concepts of deep learning, backpropagation, automatic differentiation, and tensor operations in a minimalistic, easy-to-follow implementation. May be practically useful in scenarios where the library's small size and low dependency requirements are advantageous.\n\n## Install nptorch using pip:\n\n```bash\npip install nptorch\n\n## Getting Started\n\n\n```python\nimport nptorch as nt\n\n# Create tensors\nx = nt.tensor([[1.0, 2], [3, 4]], requires_grad=True)\ny = nt.tensor([[5.0, 6], [7, 8]], requires_grad=True)\n\n# Perform operations\nz = x + y\nw = z.mean()\nw.backward()\n\n# Print results\nprint(\"z:\", z)\nprint(\"x.grad:\", x.grad)\nprint(\"y.grad:\", y.grad)\n```\n\n z: tensor([[ 6. 8.]\n [10. 12.]], float32, grad_fn=<'Add' at 0x722942528260>)\n x.grad: tensor([[0.25 0.25]\n [0.25 0.25]], float32)\n y.grad: tensor([[0.25 0.25]\n [0.25 0.25]], float32)\n\n\n\n```python\n\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A PyTorch clone made using NumPy (for CPU) and CuPy (for GPU)",
"version": "0.0.2",
"project_urls": {
"Homepage": "https://github.com/bhawik-jani/nptorch"
},
"split_keywords": [
"pytorch",
" numpy",
" automatic differentiation",
" back propagation",
" deep learning",
" neural networks",
" cupy",
" auto grad"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "463f31ebdb17272f752a7168f3c6bd0adc9d271a7858431ff2564ee6745d7311",
"md5": "95ce4f8d673afe869f6894cdeff79cd7",
"sha256": "b187beff19a3b789eea44613324fae9316d76524133a7e607d5a897be70934d0"
},
"downloads": -1,
"filename": "nptorch-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "95ce4f8d673afe869f6894cdeff79cd7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 19629,
"upload_time": "2025-02-01T12:11:19",
"upload_time_iso_8601": "2025-02-01T12:11:19.398033Z",
"url": "https://files.pythonhosted.org/packages/46/3f/31ebdb17272f752a7168f3c6bd0adc9d271a7858431ff2564ee6745d7311/nptorch-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "066de27a6c4a74819fd6c403077f3b461f3be319f2f7b571f2867a6fe5e31fbd",
"md5": "e00c40f520d3003587beac9b52b061db",
"sha256": "c40c896ee21aa1229eb8be75403c8dfa55edf74b308bd6ea747fba574e95de40"
},
"downloads": -1,
"filename": "nptorch-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "e00c40f520d3003587beac9b52b061db",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 19119,
"upload_time": "2025-02-01T12:11:21",
"upload_time_iso_8601": "2025-02-01T12:11:21.569964Z",
"url": "https://files.pythonhosted.org/packages/06/6d/e27a6c4a74819fd6c403077f3b461f3be319f2f7b571f2867a6fe5e31fbd/nptorch-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-01 12:11:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bhawik-jani",
"github_project": "nptorch",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "nptorch"
}