tensorplot-rs 0.1.0__py3-none-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,113 @@
1
+ Metadata-Version: 2.4
2
+ Name: tensorplot-rs
3
+ Version: 0.1.0
4
+ Classifier: Development Status :: 4 - Beta
5
+ Classifier: Environment :: Console
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: Intended Audience :: Science/Research
8
+ Classifier: Operating System :: MacOS
9
+ Classifier: Operating System :: Microsoft :: Windows
10
+ Classifier: Operating System :: POSIX :: Linux
11
+ Classifier: Programming Language :: Rust
12
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
13
+ Classifier: Topic :: Scientific/Engineering :: Visualization
14
+ License-File: LICENSE
15
+ Summary: Neural network architecture diagrams for papers — CNNs to LLMs (TikZ, SVG, PNG, PDF).
16
+ Keywords: neural-network,diagram,tikz,svg,pdf,llm,onnx,cli
17
+ Home-Page: https://github.com/kaanrkaraman/tensorplot
18
+ Author-email: Recep Kaan Karaman <kaanrkaraman@gmail.com>
19
+ License-Expression: MIT
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
22
+ Project-URL: Homepage, https://github.com/kaanrkaraman/tensorplot
23
+ Project-URL: Issues, https://github.com/kaanrkaraman/tensorplot/issues
24
+ Project-URL: Repository, https://github.com/kaanrkaraman/tensorplot
25
+
26
+ # tensorplot
27
+
28
+ Neural network architecture diagrams for papers — CNNs to LLMs.
29
+ Inspired by [PlotNeuralNet](https://github.com/HarisIqbal88/PlotNeuralNet) (MIT), rewritten in Rust,
30
+ same visual style, no LaTeX required (but TikZ output when you want it).
31
+
32
+ ![VGG16](https://raw.githubusercontent.com/kaanrkaraman/tensorplot/master/docs/vgg16.png)
33
+ ![DeepSeek-V3 from its config.json](https://raw.githubusercontent.com/kaanrkaraman/tensorplot/master/docs/deepseek-v3.png)
34
+
35
+ ## Install
36
+
37
+ ```sh
38
+ cargo install tensorplot-rs # crates.io
39
+ uv tool install tensorplot-rs # PyPI (or: pip install tensorplot-rs)
40
+ ```
41
+
42
+ Both install the `tensorplot` CLI binary.
43
+
44
+ ## Usage
45
+
46
+ ```sh
47
+ tensorplot examples/vgg16.toml -o vgg16.svg # SVG
48
+ tensorplot examples/vgg16.toml -o vgg16.png # PNG
49
+ tensorplot examples/vgg16.toml -o vgg16.pdf # vector PDF, fonts embedded
50
+ tensorplot examples/vgg16.toml -o vgg16.tex # standalone TikZ (pdflatex)
51
+ tensorplot examples/vgg16.toml -o fig.tex --snippet # bare tikzpicture for \input
52
+ tensorplot examples/hf/deepseek-v3.json -o ds.svg # Hugging Face config.json
53
+ tensorplot examples/onnx/tiny-resnet.onnx -o resnet.svg # ONNX model
54
+ ```
55
+
56
+ The snippet needs `\usepackage{tikz}` and `\usetikzlibrary{arrows.meta}` in your preamble.
57
+
58
+ **Playground:** `docs/playground/` runs the same renderer as WASM in the browser: edit a spec,
59
+ open a `.json` / `.onnx`, download SVG or TikZ. Serve it with `python3 -m http.server -d docs`
60
+ and open `/playground/`. Rebuild with `docs/playground/build.sh` (needs the
61
+ `wasm32-unknown-unknown` target).
62
+
63
+ ## Spec
64
+
65
+ Layers are laid out left to right; sizes are derived from the dimensions.
66
+
67
+ ```toml
68
+ [[layer]]
69
+ kind = "conv" # see kinds below
70
+ name = "conv1" # caption
71
+ channels = [64, 64] # one box per conv
72
+ size = 224 # spatial size; conv inherits, pool halves
73
+ relu = true # activation band
74
+
75
+ [[layer]]
76
+ kind = "pool"
77
+ ```
78
+
79
+ | kind | needs | draws |
80
+ |---|---|---|
81
+ | `conv` | `channels`, `size` | one box per channel entry |
82
+ | `pool` | `size` (inherited) | attached slab, halves size |
83
+ | `fc` | `units` | long bar |
84
+ | `softmax` | — | attached bar |
85
+ | `embed` | `dim`, optional `seq`, `units` (vocab) | token embedding |
86
+ | `norm` | `dim`; `rms = true` for RMSNorm | thin slab |
87
+ | `attention` | `heads`, `dim`; `kv_heads` (GQA/MQA), `kv_rank` (MLA) | Q, (latent), K, V, O; box width shows head count |
88
+ | `ffn` | `hidden`, `dim`; `act = "swiglu" \| "gelu" \| "relu"` | gate/up/down projections |
89
+ | `moe` | `experts`, `hidden`, `dim`; `top_k`, `shared` | router, shared and routed experts, active ones banded |
90
+ | `repeat` | `times`, nested `[[layer.layer]]` | dashed frame labelled `×N` |
91
+
92
+ `dim` and `seq` are inherited like `size`. See `examples/llama3-8b.toml`.
93
+
94
+ **Graph:** every layer can take
95
+
96
+ - `id` — reference name (defaults to `name`)
97
+ - `from = ["a", "b"]` — inputs (default: previous layer). A second consumer of the same input
98
+ branches onto a new row; several inputs merge (`examples/inception.toml`)
99
+ - `skip = ["a"]` — residual: `a`'s output is added to this layer's input, drawn as an arc
100
+ (`examples/resnet18.toml`)
101
+ - `row` — explicit vertical offset in cm
102
+
103
+ Optional per layer: `gap` (cm before the layer), `label` (depth label, `""` hides),
104
+ `height` / `depth` / `width` (raw PlotNeuralNet units).
105
+
106
+ ## Importers
107
+
108
+ - **Hugging Face `config.json`** (decoder-only LLMs): Llama, Mistral/Mixtral, Qwen, DeepSeek
109
+ (MLA, dense-then-MoE layers), GPT-2 key aliases, and multimodal `text_config`.
110
+ - **ONNX**: Conv, pooling, Gemm/MatMul, Softmax and LayerNorm become layers; activations add the
111
+ band; `Add` of an identity becomes a skip, other `Add`s and `Concat` merge. Other ops pass
112
+ through. Shapes come from the weight initializers and the graph input; no onnxruntime needed.
113
+
@@ -0,0 +1,6 @@
1
+ tensorplot_rs-0.1.0.data/scripts/tensorplot.exe,sha256=riI8oXWTBa8qbo-yXHvvX7PPe5fUjxW0XTQtkF8KFfc,5360640
2
+ tensorplot_rs-0.1.0.dist-info/METADATA,sha256=sfvk5XIJcKkKAuhLGcOeJzX1HTLCe9_8_71hND59BrQ,5081
3
+ tensorplot_rs-0.1.0.dist-info/WHEEL,sha256=Uvw7WSmy7Kj2FBk8Va4L_dq4MDW8X5Ynby-pOX3ZNS0,94
4
+ tensorplot_rs-0.1.0.dist-info/licenses/LICENSE,sha256=dm16QBRjgXHvzzkA_mOMjxNVIk_w4Lo0sqqHAhreFgg,1082
5
+ tensorplot_rs-0.1.0.dist-info/sboms/tensorplot-rs.cyclonedx.json,sha256=caE7Ov0_P2Yi4I1YONPUSx9vMpl93Eh0DDw-0MUGBaE,131994
6
+ tensorplot_rs-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.16.0)
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-win_amd64
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kaan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.