{
  "markdown": "<div align=\"center\">\n\n<img alt=\"VisualTorch\" height=\"70\" src=\"https://raw.githubusercontent.com/willyfh/visualtorch/main/docs/source/_static/images/logos/wordmark-light.png\" />\n\n<br/>\n<br/>\n\n[![python](https://img.shields.io/badge/python-3.10%2B-blue)]() [![pytorch](https://img.shields.io/badge/pytorch-2.0%2B-orange)]() [![Downloads](https://static.pepy.tech/personalized-badge/visualtorch?period=total&units=international_system&left_color=grey&right_color=green&left_text=PyPI%20Downloads)](https://pepy.tech/project/visualtorch) [![Run Tests](https://github.com/willyfh/visualtorch/actions/workflows/pytest.yml/badge.svg)](https://github.com/willyfh/visualtorch/actions/workflows/pytest.yml) [![Documentation Status](https://readthedocs.org/projects/visualtorch/badge/?version=latest)](https://visualtorch.readthedocs.io/en/latest/?badge=latest)\n\n</div>\n\n**VisualTorch** aims to help visualize Torch-based neural network architectures. It currently supports generating flow-style, graph-style, and LeNet-style architectures for PyTorch Sequential and Custom models. Its original visual styles were inspired by [visualkeras](https://github.com/paulgavrikov/visualkeras), [pytorchviz](https://github.com/szagoruyko/pytorchviz), [pytorch-summary](https://github.com/sksq96/pytorch-summary), and [torchview](https://github.com/mert-kurttutan/torchview); since then, it has grown its own unified tracing backend and architecture-handling logic well beyond its origins.\n\n**Note:** `1.0+` is a major release with breaking API changes, but with significantly better features and algorithms - upgrading is recommended. For the old API, use `0.2.5` or older.\n\n**Limitation:** VisualTorch traces a real forward pass to build the diagram, which has an inherent\nlimitation shared by any tracing-based approach (not a bug, and not fixable without full symbolic\nexecution): models with **data-dependent control flow** (e.g. a branch only taken if a tensor\nvalue crosses some threshold) only show whichever branch the traced dummy input happened to take.\nSeparately, a layer that returns **multiple meaningful output tensors** (e.g. a custom multi-task\nhead, or `nn.LSTM`'s `(output, (h_n, c_n))`) still has its node's size based on only its first\ntensor; with `show_dimension=True`, every output tensor's shape is shown in the label, not just\nthe first. Downstream connections are correct either way. Contributions are welcome!\n\n<div align=\"center\">\n\n![VisualTorch Examples](https://raw.githubusercontent.com/willyfh/visualtorch/e6ad79751e0f7412b1074beb45f9baeccd1419e4/docs/source/_static/images/banners/readme-examples.png)\n\n</div>\n\n### Animated Reveal\n\nEvery style can also render as an animated GIF, revealing the model one layer/column at a time,\nvia `visualtorch.animate(model, input_shape, style=...)` - see it in action for\n[flow](https://visualtorch.readthedocs.io/en/latest/usage_examples/flow/plot_animated_reveal_flow.html),\n[graph](https://visualtorch.readthedocs.io/en/latest/usage_examples/graph/plot_animated_reveal_graph.html), and\n[lenet](https://visualtorch.readthedocs.io/en/latest/usage_examples/lenet_style/plot_animated_reveal_lenet_style.html) styles.\n\n<div align=\"center\">\n\n![Animated VisualTorch Example](https://raw.githubusercontent.com/willyfh/visualtorch/57ce9d41e7a2dfdb76c4b6cf0df82b0c5c0846e5/docs/source/_static/images/banners/readme-animated-demo.gif)\n\n</div>\n\n## Documentation\n\nOnline documentation is available at [visualtorch.readthedocs.io](https://visualtorch.readthedocs.io/en/latest/).\n\nThe docs include [usage examples](https://visualtorch.readthedocs.io/en/latest/usage_examples/index.html), [API references](https://visualtorch.readthedocs.io/en/latest/markdown/api_references/index.html), and other useful information.\n\n## Installation\n\nSee the [Installation page](https://visualtorch.readthedocs.io/en/latest/markdown/get_started/installation.html).\n\n## MCP integration\n\nVisualTorch includes an optional, client-neutral stdio MCP server for generating static PNG\ndiagrams and animated GIF reveals from PyTorch model source. It exposes capability discovery,\nstructured output metadata, documentation resources, subprocess timeouts, and all three canonical\nstyles (`graph`, `flow`, and `lenet`). Install it with `pip install \"visualtorch[mcp]\"` and see the\n[MCP integration guide](https://visualtorch.readthedocs.io/en/latest/markdown/get_started/mcp.html)\nfor the tool schemas, generic stdio configuration, examples, and trusted-code security boundary.\nNo client-specific plugin or extension is required.\n\n<!-- mcp-name: io.github.willyfh/visualtorch -->\n\n## Used in Research\n\nVisualTorch has been used in published research, including works published in Nature, IEEE, and MDPI.\n\nSee the [Research Showcase page](https://visualtorch.readthedocs.io/en/latest/markdown/showcase/index.html) for the full list.\n\nUsed VisualTorch in your research, built something with it, or found a paper that cites it? [Tell us about it](https://github.com/willyfh/visualtorch/discussions) or [open a pull request](https://github.com/willyfh/visualtorch/pulls) to add it directly - we'd love to hear.\n\n## Examples\n\nSee the [Usage Examples page](https://visualtorch.readthedocs.io/en/latest/usage_examples/index.html).\n\n## Contributing\n\nPlease feel free to send a pull request to contribute to this project by following this [guideline](https://github.com/willyfh/visualtorch/blob/main/CONTRIBUTING.md).\n\n## Releases\n\nSee [GOVERNANCE.md](https://github.com/willyfh/visualtorch/blob/main/GOVERNANCE.md#release-process) for release methodology and cadence, and the [PyPI release history](https://pypi.org/project/visualtorch/#history) for past releases.\n\n## License\n\nThis poject is available as open source under the terms of the [MIT License](https://github.com/willyfh/visualtorch/blob/main/LICENSE.md).\n\nOriginally, this project was based on the [visualkeras](https://github.com/paulgavrikov/visualkeras) (under the MIT license), with additional modifications inspired by [pytorchviz](https://github.com/szagoruyko/pytorchviz), [pytorch-summary](https://github.com/sksq96/pytorch-summary), and [torchview](https://github.com/mert-kurttutan/torchview), all of which are also licensed under the MIT license.\n\n## Citation\n\nPlease cite this project in your publications if it helps your research.\n\n**Note:** the paper below describes VisualTorch as of its publication date (2024). The project has\nsince been substantially refactored, including breaking API changes (see the\n[documentation](https://visualtorch.readthedocs.io/en/latest/) for the current API) - the DOI\nalways resolves to what was actually reviewed and published.\n\n```bibtex\n@article{Hendria2024,\n  doi = {10.21105/joss.06678},\n  url = {https://doi.org/10.21105/joss.06678},\n  year = {2024},\n  publisher = {The Open Journal},\n  volume = {9},\n  number = {102},\n  pages = {6678},\n  author = {Willy Fitra Hendria and Paul Gavrikov},\n  title = {VisualTorch: Streamlining Visualization for PyTorch Neural Network Architectures},\n  journal = {Journal of Open Source Software}\n}\n```\n\n## Star History\n\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/willyfh/visualtorch/assets/docs/source/_static/images/star-history-dark.png\" />\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/willyfh/visualtorch/assets/docs/source/_static/images/star-history-light.png\" />\n  <img alt=\"Star History Chart\" src=\"https://raw.githubusercontent.com/willyfh/visualtorch/assets/docs/source/_static/images/star-history-light.png\" />\n</picture>\n",
  "bytes": 7585,
  "sha": "4d813a1d1a3cb028b1fab91b0433ebb14e88d9a71c7291864e1ba71c8a47d7c1",
  "repo_slug": "willyfh/visualtorch",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_willyfh_visualtorch_ec4565a2/readme"
}