torchviz2


Nametorchviz2 JSON
Version 0.0.2 PyPI version JSON
download
home_pageNone
SummaryA small package to create visualizations of PyTorch execution graphs
upload_time2024-09-28 15:22:49
maintainerNone
docs_urlNone
authorLeo Ware
requires_pythonNone
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            PyTorchViz
==========

**This is a fork of the original package `torchviz`, which is no longer maintained.**

A small package to create visualizations of PyTorch execution graphs and traces.

## Installation

Install graphviz, e.g.:

```
brew install graphviz
```

Install the package itself:

```
pip install torchviz2
```


## Usage
Example usage of `make_dot`:
```
import torch
from torch import nn
from torchviz import make_dot

model = nn.Sequential()
model.add_module('W0', nn.Linear(8, 16))
model.add_module('tanh', nn.Tanh())
model.add_module('W1', nn.Linear(16, 1))

x = torch.randn(1, 8)
y = model(x)

make_dot(y.mean(), params=dict(model.named_parameters()))
```
![image](https://user-images.githubusercontent.com/13428986/110844921-ff3f7500-8277-11eb-912e-3ba03623fdf5.png)

Set `show_attrs=True` and `show_saved=True` to see what autograd saves for the backward pass. (Note that this is only available for pytorch >= 1.9.)
```
model = nn.Sequential()
model.add_module('W0', nn.Linear(8, 16))
model.add_module('tanh', nn.Tanh())
model.add_module('W1', nn.Linear(16, 1))

x = torch.randn(1, 8)
y = model(x)

make_dot(y.mean(), params=dict(model.named_parameters()), show_attrs=True, show_saved=True)
```
![image](https://user-images.githubusercontent.com/13428986/110845186-4ded0f00-8278-11eb-88d2-cc33413bb261.png)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "torchviz2",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Leo Ware",
    "author_email": "leoware@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/5b/9f/c0e0d7e790003c8bc7c7db5ccaf49710a1ccc46de066bbb6b630ef5b55c8/torchviz2-0.0.2.tar.gz",
    "platform": null,
    "description": "PyTorchViz\n==========\n\n**This is a fork of the original package `torchviz`, which is no longer maintained.**\n\nA small package to create visualizations of PyTorch execution graphs and traces.\n\n## Installation\n\nInstall graphviz, e.g.:\n\n```\nbrew install graphviz\n```\n\nInstall the package itself:\n\n```\npip install torchviz2\n```\n\n\n## Usage\nExample usage of `make_dot`:\n```\nimport torch\nfrom torch import nn\nfrom torchviz import make_dot\n\nmodel = nn.Sequential()\nmodel.add_module('W0', nn.Linear(8, 16))\nmodel.add_module('tanh', nn.Tanh())\nmodel.add_module('W1', nn.Linear(16, 1))\n\nx = torch.randn(1, 8)\ny = model(x)\n\nmake_dot(y.mean(), params=dict(model.named_parameters()))\n```\n![image](https://user-images.githubusercontent.com/13428986/110844921-ff3f7500-8277-11eb-912e-3ba03623fdf5.png)\n\nSet `show_attrs=True` and `show_saved=True` to see what autograd saves for the backward pass. (Note that this is only available for pytorch >= 1.9.)\n```\nmodel = nn.Sequential()\nmodel.add_module('W0', nn.Linear(8, 16))\nmodel.add_module('tanh', nn.Tanh())\nmodel.add_module('W1', nn.Linear(16, 1))\n\nx = torch.randn(1, 8)\ny = model(x)\n\nmake_dot(y.mean(), params=dict(model.named_parameters()), show_attrs=True, show_saved=True)\n```\n![image](https://user-images.githubusercontent.com/13428986/110845186-4ded0f00-8278-11eb-88d2-cc33413bb261.png)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A small package to create visualizations of PyTorch execution graphs",
    "version": "0.0.2",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "62897aa6ad8acb05a26b83ebfc510fb61eaeb1ca74480ea390d8cd26adba2a5f",
                "md5": "eb97770daac503445ab5c275f27816eb",
                "sha256": "b81fc6e925136cb97c21893355941c39aa6ce9f0d45e3aef8d54d0ac0eacaa47"
            },
            "downloads": -1,
            "filename": "torchviz2-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "eb97770daac503445ab5c275f27816eb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5515,
            "upload_time": "2024-09-28T15:22:47",
            "upload_time_iso_8601": "2024-09-28T15:22:47.981510Z",
            "url": "https://files.pythonhosted.org/packages/62/89/7aa6ad8acb05a26b83ebfc510fb61eaeb1ca74480ea390d8cd26adba2a5f/torchviz2-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5b9fc0e0d7e790003c8bc7c7db5ccaf49710a1ccc46de066bbb6b630ef5b55c8",
                "md5": "b5ce97f04ca4bc758c3b2421343fa768",
                "sha256": "7db33c6701354dc48944d51fd267fc72df9b141007bfcd7ca7963198ebc26fe5"
            },
            "downloads": -1,
            "filename": "torchviz2-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "b5ce97f04ca4bc758c3b2421343fa768",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5680,
            "upload_time": "2024-09-28T15:22:49",
            "upload_time_iso_8601": "2024-09-28T15:22:49.427197Z",
            "url": "https://files.pythonhosted.org/packages/5b/9f/c0e0d7e790003c8bc7c7db5ccaf49710a1ccc46de066bbb6b630ef5b55c8/torchviz2-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-28 15:22:49",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "torchviz2"
}
        
Elapsed time: 7.73114s