{
  "format": "tensorviz.graph",
  "version": 3,
  "exportedAt": "2026-09-17T06:18:49.600088+00:00",
  "status": "static",
  "warningCount": 0,
  "document": {
    "schemaVersion": 2,
    "semantic": {
      "graph_id": "snapshot",
      "name": "TinyViT",
      "revision": 0,
      "nodes": [
        {
          "node_id": "input",
          "kind": "input",
          "op": "Input",
          "params": {
            "shape": "1,3,16,16"
          },
          "in_ports": [],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "input",
              "name": "Input",
              "displayName": "Input",
              "description": "Model input node",
              "icon": "ArrowRight",
              "category": "io",
              "parameters": [
                {
                  "name": "shape",
                  "type": "string",
                  "defaultValue": "1,3,224,224",
                  "required": true,
                  "description": "Input tensor shape (comma-separated, e.g., 1,3,224,224)"
                },
                {
                  "name": "name",
                  "type": "string",
                  "defaultValue": "input",
                  "required": false,
                  "description": "Name for this input"
                }
              ]
            }
          }
        },
        {
          "node_id": "patches",
          "kind": "module",
          "op": "Module",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "module",
              "name": "Module",
              "displayName": "Module",
              "description": "Custom module group (nn.Module)",
              "icon": "Package",
              "category": "module",
              "parameters": [
                {
                  "name": "name",
                  "type": "string",
                  "defaultValue": "CustomModule",
                  "required": true,
                  "description": "Module class name"
                },
                {
                  "name": "description",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Module description"
                }
              ]
            },
            "moduleInstanceId": "patches",
            "moduleTemplateId": "model::PatchEmbedding",
            "isGroup": true,
            "moduleMembers": [
              "patches.project",
              "flatten@patches#0",
              "python@patches#0"
            ],
            "moduleLayerCount": 3
          }
        },
        {
          "node_id": "class_token",
          "kind": "layer",
          "op": "Parameter",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "parameter",
              "description": "",
              "category": "misc",
              "icon": "Box",
              "parameters": [],
              "name": "Parameter",
              "displayName": "Parameter"
            }
          }
        },
        {
          "node_id": "python@TinyViT#0",
          "kind": "layer",
          "op": "Python",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "python",
              "name": "Python",
              "displayName": "Python",
              "description": "A statement from the source file that has no graph equivalent. Its code is kept verbatim and its shape is unknown until the model is traced.",
              "icon": "Hash",
              "category": "misc",
              "parameters": []
            }
          }
        },
        {
          "node_id": "cat@TinyViT#0",
          "kind": "layer",
          "op": "torch.cat",
          "params": {
            "dim": 1
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "cat",
              "name": "torch.cat",
              "displayName": "torch.cat",
              "description": "PyTorch cat operation",
              "icon": "Activity",
              "category": "tensor",
              "parameters": [
                {
                  "name": "dim",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Dimension(s) to apply the operation on"
                }
              ]
            }
          }
        },
        {
          "node_id": "positions",
          "kind": "layer",
          "op": "Parameter",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "parameter",
              "description": "",
              "category": "misc",
              "icon": "Box",
              "parameters": [],
              "name": "Parameter",
              "displayName": "Parameter"
            }
          }
        },
        {
          "node_id": "add@TinyViT#0",
          "kind": "layer",
          "op": "torch.add",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "add",
              "name": "torch.add",
              "displayName": "torch.add",
              "description": "PyTorch add operation",
              "icon": "Activity",
              "category": "tensor",
              "parameters": [
                {
                  "name": "dim",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Dimension(s) to apply the operation on"
                }
              ]
            }
          }
        },
        {
          "node_id": "encoder",
          "kind": "module",
          "op": "Module",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "module",
              "name": "Module",
              "displayName": "Module",
              "description": "Custom module group (nn.Module)",
              "icon": "Package",
              "category": "module",
              "parameters": [
                {
                  "name": "name",
                  "type": "string",
                  "defaultValue": "CustomModule",
                  "required": true,
                  "description": "Module class name"
                },
                {
                  "name": "description",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Module description"
                }
              ]
            },
            "moduleInstanceId": "encoder",
            "moduleTemplateId": "model::Encoder",
            "isGroup": true,
            "moduleMembers": [
              "encoder.norm1",
              "encoder.attention",
              "add@encoder#0",
              "encoder.norm2",
              "encoder.up",
              "encoder.gelu",
              "encoder.down",
              "add@encoder#1"
            ],
            "moduleLayerCount": 16
          }
        },
        {
          "node_id": "norm",
          "kind": "layer",
          "op": "LayerNorm",
          "params": {
            "normalized_shape": 16
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "layernorm",
              "name": "LayerNorm",
              "displayName": "LayerNorm",
              "description": "Layer Normalization",
              "icon": "Layers",
              "category": "norm",
              "parameters": [
                {
                  "name": "normalized_shape",
                  "type": "string",
                  "defaultValue": "512",
                  "required": true,
                  "description": "Input shape for normalization (comma-separated for multi-dim, e.g., 512)"
                },
                {
                  "name": "eps",
                  "type": "number",
                  "defaultValue": 0.00001,
                  "required": false,
                  "description": "Value for numerical stability",
                  "min": 0
                },
                {
                  "name": "elementwise_affine",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If True, learnable affine parameters"
                }
              ]
            }
          }
        },
        {
          "node_id": "head",
          "kind": "layer",
          "op": "Linear",
          "params": {
            "in_features": 16,
            "out_features": 3
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "linear",
              "name": "Linear",
              "displayName": "Linear",
              "description": "Fully Connected Layer",
              "icon": "Minus",
              "category": "linear",
              "parameters": [
                {
                  "name": "in_features",
                  "type": "number",
                  "defaultValue": 512,
                  "required": true,
                  "description": "Size of input features",
                  "min": 1
                },
                {
                  "name": "out_features",
                  "type": "number",
                  "defaultValue": 256,
                  "required": true,
                  "description": "Size of output features",
                  "min": 1
                },
                {
                  "name": "bias",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If set to False, the layer will not learn an additive bias"
                }
              ]
            }
          }
        },
        {
          "node_id": "output",
          "kind": "output",
          "op": "Output",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [],
          "metadata": {
            "layerType": {
              "id": "output",
              "name": "Output",
              "displayName": "Output",
              "description": "Model output node",
              "icon": "ArrowLeft",
              "category": "io",
              "parameters": [
                {
                  "name": "name",
                  "type": "string",
                  "defaultValue": "output",
                  "required": false,
                  "description": "Name for this output"
                }
              ]
            }
          }
        },
        {
          "node_id": "patches.project",
          "kind": "layer",
          "op": "Conv2d",
          "params": {
            "in_channels": 3,
            "out_channels": 16,
            "kernel_size": 4,
            "stride": 4
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "conv2d",
              "name": "Conv2d",
              "displayName": "Conv2D",
              "description": "2D Convolutional Layer",
              "icon": "Grid3X3",
              "category": "conv",
              "parameters": [
                {
                  "name": "in_channels",
                  "type": "number",
                  "defaultValue": 3,
                  "required": true,
                  "description": "Number of input channels",
                  "min": 1
                },
                {
                  "name": "out_channels",
                  "type": "number",
                  "defaultValue": 64,
                  "required": true,
                  "description": "Number of output channels",
                  "min": 1
                },
                {
                  "name": "kernel_size",
                  "type": "number",
                  "defaultValue": 3,
                  "required": true,
                  "description": "Size of the convolving kernel",
                  "min": 1
                },
                {
                  "name": "stride",
                  "type": "number",
                  "defaultValue": 1,
                  "required": false,
                  "description": "Stride of the convolution",
                  "min": 1
                },
                {
                  "name": "padding",
                  "type": "number",
                  "defaultValue": 0,
                  "required": false,
                  "description": "Zero-padding added to both sides",
                  "min": 0
                },
                {
                  "name": "dilation",
                  "type": "number",
                  "defaultValue": 1,
                  "required": false,
                  "description": "Spacing between kernel elements",
                  "min": 1
                },
                {
                  "name": "groups",
                  "type": "number",
                  "defaultValue": 1,
                  "required": false,
                  "description": "Number of blocked connections from input to output channels",
                  "min": 1
                },
                {
                  "name": "bias",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If True, adds a learnable bias"
                }
              ]
            },
            "parentId": "patches"
          }
        },
        {
          "node_id": "flatten@patches#0",
          "kind": "layer",
          "op": "Flatten",
          "params": {
            "start_dim": 2
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "flatten",
              "name": "Flatten",
              "displayName": "Flatten",
              "description": "Flattens input tensor contiguously",
              "icon": "Maximize2",
              "category": "tensor",
              "parameters": [
                {
                  "name": "start_dim",
                  "type": "number",
                  "defaultValue": 1,
                  "required": false,
                  "description": "First dim to flatten",
                  "min": 0
                },
                {
                  "name": "end_dim",
                  "type": "number",
                  "defaultValue": -1,
                  "required": false,
                  "description": "Last dim to flatten"
                }
              ]
            },
            "parentId": "patches"
          }
        },
        {
          "node_id": "python@patches#0",
          "kind": "layer",
          "op": "Python",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "python",
              "name": "Python",
              "displayName": "Python",
              "description": "A statement from the source file that has no graph equivalent. Its code is kept verbatim and its shape is unknown until the model is traced.",
              "icon": "Hash",
              "category": "misc",
              "parameters": []
            },
            "parentId": "patches"
          }
        },
        {
          "node_id": "encoder.norm1",
          "kind": "layer",
          "op": "LayerNorm",
          "params": {
            "normalized_shape": 16
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "layernorm",
              "name": "LayerNorm",
              "displayName": "LayerNorm",
              "description": "Layer Normalization",
              "icon": "Layers",
              "category": "norm",
              "parameters": [
                {
                  "name": "normalized_shape",
                  "type": "string",
                  "defaultValue": "512",
                  "required": true,
                  "description": "Input shape for normalization (comma-separated for multi-dim, e.g., 512)"
                },
                {
                  "name": "eps",
                  "type": "number",
                  "defaultValue": 0.00001,
                  "required": false,
                  "description": "Value for numerical stability",
                  "min": 0
                },
                {
                  "name": "elementwise_affine",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If True, learnable affine parameters"
                }
              ]
            },
            "parentId": "encoder"
          }
        },
        {
          "node_id": "encoder.attention",
          "kind": "module",
          "op": "Module",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "module",
              "name": "Module",
              "displayName": "Module",
              "description": "Custom module group (nn.Module)",
              "icon": "Package",
              "category": "module",
              "parameters": [
                {
                  "name": "name",
                  "type": "string",
                  "defaultValue": "CustomModule",
                  "required": true,
                  "description": "Module class name"
                },
                {
                  "name": "description",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Module description"
                }
              ]
            },
            "parentId": "encoder",
            "moduleInstanceId": "encoder.attention",
            "moduleTemplateId": "model::Attention",
            "isGroup": true,
            "moduleMembers": [
              "encoder.attention.query",
              "python@encoder.attention#0",
              "encoder.attention.key",
              "python@encoder.attention#1",
              "div@encoder.attention#0",
              "encoder.attention.value",
              "python@encoder.attention#2",
              "encoder.attention.softmax",
              "encoder.attention.project"
            ],
            "moduleLayerCount": 9
          }
        },
        {
          "node_id": "add@encoder#0",
          "kind": "layer",
          "op": "torch.add",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "add",
              "name": "torch.add",
              "displayName": "torch.add",
              "description": "PyTorch add operation",
              "icon": "Activity",
              "category": "tensor",
              "parameters": [
                {
                  "name": "dim",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Dimension(s) to apply the operation on"
                }
              ]
            },
            "parentId": "encoder"
          }
        },
        {
          "node_id": "encoder.norm2",
          "kind": "layer",
          "op": "LayerNorm",
          "params": {
            "normalized_shape": 16
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "layernorm",
              "name": "LayerNorm",
              "displayName": "LayerNorm",
              "description": "Layer Normalization",
              "icon": "Layers",
              "category": "norm",
              "parameters": [
                {
                  "name": "normalized_shape",
                  "type": "string",
                  "defaultValue": "512",
                  "required": true,
                  "description": "Input shape for normalization (comma-separated for multi-dim, e.g., 512)"
                },
                {
                  "name": "eps",
                  "type": "number",
                  "defaultValue": 0.00001,
                  "required": false,
                  "description": "Value for numerical stability",
                  "min": 0
                },
                {
                  "name": "elementwise_affine",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If True, learnable affine parameters"
                }
              ]
            },
            "parentId": "encoder"
          }
        },
        {
          "node_id": "encoder.up",
          "kind": "layer",
          "op": "Linear",
          "params": {
            "in_features": 16,
            "out_features": 32
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "linear",
              "name": "Linear",
              "displayName": "Linear",
              "description": "Fully Connected Layer",
              "icon": "Minus",
              "category": "linear",
              "parameters": [
                {
                  "name": "in_features",
                  "type": "number",
                  "defaultValue": 512,
                  "required": true,
                  "description": "Size of input features",
                  "min": 1
                },
                {
                  "name": "out_features",
                  "type": "number",
                  "defaultValue": 256,
                  "required": true,
                  "description": "Size of output features",
                  "min": 1
                },
                {
                  "name": "bias",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If set to False, the layer will not learn an additive bias"
                }
              ]
            },
            "parentId": "encoder"
          }
        },
        {
          "node_id": "encoder.gelu",
          "kind": "layer",
          "op": "GELU",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "gelu",
              "name": "GELU",
              "displayName": "GELU",
              "description": "Gaussian Error Linear Unit",
              "icon": "TrendingUp",
              "category": "activation",
              "parameters": [
                {
                  "name": "approximate",
                  "type": "select",
                  "defaultValue": "none",
                  "required": false,
                  "description": "The gelu approximation algorithm to use: 'none' or 'tanh'",
                  "options": [
                    "none",
                    "tanh"
                  ]
                }
              ]
            },
            "parentId": "encoder"
          }
        },
        {
          "node_id": "encoder.down",
          "kind": "layer",
          "op": "Linear",
          "params": {
            "in_features": 32,
            "out_features": 16
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "linear",
              "name": "Linear",
              "displayName": "Linear",
              "description": "Fully Connected Layer",
              "icon": "Minus",
              "category": "linear",
              "parameters": [
                {
                  "name": "in_features",
                  "type": "number",
                  "defaultValue": 512,
                  "required": true,
                  "description": "Size of input features",
                  "min": 1
                },
                {
                  "name": "out_features",
                  "type": "number",
                  "defaultValue": 256,
                  "required": true,
                  "description": "Size of output features",
                  "min": 1
                },
                {
                  "name": "bias",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If set to False, the layer will not learn an additive bias"
                }
              ]
            },
            "parentId": "encoder"
          }
        },
        {
          "node_id": "add@encoder#1",
          "kind": "layer",
          "op": "torch.add",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "add",
              "name": "torch.add",
              "displayName": "torch.add",
              "description": "PyTorch add operation",
              "icon": "Activity",
              "category": "tensor",
              "parameters": [
                {
                  "name": "dim",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Dimension(s) to apply the operation on"
                }
              ]
            },
            "parentId": "encoder"
          }
        },
        {
          "node_id": "encoder.attention.query",
          "kind": "layer",
          "op": "Linear",
          "params": {
            "in_features": 16,
            "out_features": 16
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "linear",
              "name": "Linear",
              "displayName": "Linear",
              "description": "Fully Connected Layer",
              "icon": "Minus",
              "category": "linear",
              "parameters": [
                {
                  "name": "in_features",
                  "type": "number",
                  "defaultValue": 512,
                  "required": true,
                  "description": "Size of input features",
                  "min": 1
                },
                {
                  "name": "out_features",
                  "type": "number",
                  "defaultValue": 256,
                  "required": true,
                  "description": "Size of output features",
                  "min": 1
                },
                {
                  "name": "bias",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If set to False, the layer will not learn an additive bias"
                }
              ]
            },
            "parentId": "encoder.attention"
          }
        },
        {
          "node_id": "python@encoder.attention#0",
          "kind": "layer",
          "op": "Python",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "python",
              "name": "Python",
              "displayName": "Python",
              "description": "A statement from the source file that has no graph equivalent. Its code is kept verbatim and its shape is unknown until the model is traced.",
              "icon": "Hash",
              "category": "misc",
              "parameters": []
            },
            "parentId": "encoder.attention"
          }
        },
        {
          "node_id": "encoder.attention.key",
          "kind": "layer",
          "op": "Linear",
          "params": {
            "in_features": 16,
            "out_features": 16
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "linear",
              "name": "Linear",
              "displayName": "Linear",
              "description": "Fully Connected Layer",
              "icon": "Minus",
              "category": "linear",
              "parameters": [
                {
                  "name": "in_features",
                  "type": "number",
                  "defaultValue": 512,
                  "required": true,
                  "description": "Size of input features",
                  "min": 1
                },
                {
                  "name": "out_features",
                  "type": "number",
                  "defaultValue": 256,
                  "required": true,
                  "description": "Size of output features",
                  "min": 1
                },
                {
                  "name": "bias",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If set to False, the layer will not learn an additive bias"
                }
              ]
            },
            "parentId": "encoder.attention"
          }
        },
        {
          "node_id": "python@encoder.attention#1",
          "kind": "layer",
          "op": "Python",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "python",
              "name": "Python",
              "displayName": "Python",
              "description": "A statement from the source file that has no graph equivalent. Its code is kept verbatim and its shape is unknown until the model is traced.",
              "icon": "Hash",
              "category": "misc",
              "parameters": []
            },
            "parentId": "encoder.attention"
          }
        },
        {
          "node_id": "div@encoder.attention#0",
          "kind": "layer",
          "op": "torch.div",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "div",
              "name": "torch.div",
              "displayName": "torch.div",
              "description": "PyTorch div operation",
              "icon": "Activity",
              "category": "tensor",
              "parameters": [
                {
                  "name": "dim",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Dimension(s) to apply the operation on"
                }
              ]
            },
            "parentId": "encoder.attention"
          }
        },
        {
          "node_id": "encoder.attention.value",
          "kind": "layer",
          "op": "Linear",
          "params": {
            "in_features": 16,
            "out_features": 16
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "linear",
              "name": "Linear",
              "displayName": "Linear",
              "description": "Fully Connected Layer",
              "icon": "Minus",
              "category": "linear",
              "parameters": [
                {
                  "name": "in_features",
                  "type": "number",
                  "defaultValue": 512,
                  "required": true,
                  "description": "Size of input features",
                  "min": 1
                },
                {
                  "name": "out_features",
                  "type": "number",
                  "defaultValue": 256,
                  "required": true,
                  "description": "Size of output features",
                  "min": 1
                },
                {
                  "name": "bias",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If set to False, the layer will not learn an additive bias"
                }
              ]
            },
            "parentId": "encoder.attention"
          }
        },
        {
          "node_id": "python@encoder.attention#2",
          "kind": "layer",
          "op": "Python",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "python",
              "name": "Python",
              "displayName": "Python",
              "description": "A statement from the source file that has no graph equivalent. Its code is kept verbatim and its shape is unknown until the model is traced.",
              "icon": "Hash",
              "category": "misc",
              "parameters": []
            },
            "parentId": "encoder.attention"
          }
        },
        {
          "node_id": "encoder.attention.softmax",
          "kind": "layer",
          "op": "Softmax",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "softmax",
              "name": "Softmax",
              "displayName": "Softmax",
              "description": "Softmax over a dimension",
              "icon": "TrendingUp",
              "category": "activation",
              "parameters": [
                {
                  "name": "dim",
                  "type": "number",
                  "defaultValue": 1,
                  "required": true,
                  "description": "Dimension along which Softmax is computed"
                }
              ]
            },
            "parentId": "encoder.attention"
          }
        },
        {
          "node_id": "encoder.attention.project",
          "kind": "layer",
          "op": "Linear",
          "params": {
            "in_features": 16,
            "out_features": 16
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "linear",
              "name": "Linear",
              "displayName": "Linear",
              "description": "Fully Connected Layer",
              "icon": "Minus",
              "category": "linear",
              "parameters": [
                {
                  "name": "in_features",
                  "type": "number",
                  "defaultValue": 512,
                  "required": true,
                  "description": "Size of input features",
                  "min": 1
                },
                {
                  "name": "out_features",
                  "type": "number",
                  "defaultValue": 256,
                  "required": true,
                  "description": "Size of output features",
                  "min": 1
                },
                {
                  "name": "bias",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If set to False, the layer will not learn an additive bias"
                }
              ]
            },
            "parentId": "encoder.attention"
          }
        }
      ],
      "edges": [
        {
          "edge_id": "edge-1",
          "source_node_id": "patches.project",
          "target_node_id": "flatten@patches#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-2",
          "source_node_id": "flatten@patches#0",
          "target_node_id": "python@patches#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-3",
          "source_node_id": "encoder.attention.query",
          "target_node_id": "python@encoder.attention#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-4",
          "source_node_id": "encoder.attention.key",
          "target_node_id": "python@encoder.attention#1",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-5",
          "source_node_id": "encoder.attention.value",
          "target_node_id": "python@encoder.attention#2",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-6",
          "source_node_id": "python@encoder.attention#0",
          "target_node_id": "div@encoder.attention#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-7",
          "source_node_id": "python@encoder.attention#1",
          "target_node_id": "div@encoder.attention#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-8",
          "source_node_id": "div@encoder.attention#0",
          "target_node_id": "encoder.attention.softmax",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-9",
          "source_node_id": "encoder.attention.softmax",
          "target_node_id": "encoder.attention.project",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-10",
          "source_node_id": "python@encoder.attention#2",
          "target_node_id": "encoder.attention.project",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-11",
          "source_node_id": "encoder.norm1",
          "target_node_id": "encoder.attention.query",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-12",
          "source_node_id": "encoder.norm1",
          "target_node_id": "python@encoder.attention#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-13",
          "source_node_id": "encoder.norm1",
          "target_node_id": "encoder.attention.key",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-14",
          "source_node_id": "encoder.norm1",
          "target_node_id": "python@encoder.attention#1",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-15",
          "source_node_id": "encoder.norm1",
          "target_node_id": "encoder.attention.value",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-16",
          "source_node_id": "encoder.norm1",
          "target_node_id": "python@encoder.attention#2",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-17",
          "source_node_id": "encoder.norm1",
          "target_node_id": "encoder.attention.project",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-18",
          "source_node_id": "encoder.norm1",
          "target_node_id": "encoder.attention",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-19",
          "source_node_id": "encoder.attention.project",
          "target_node_id": "add@encoder#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-20",
          "source_node_id": "encoder.attention",
          "target_node_id": "add@encoder#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-21",
          "source_node_id": "add@encoder#0",
          "target_node_id": "encoder.norm2",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-22",
          "source_node_id": "encoder.norm2",
          "target_node_id": "encoder.up",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-23",
          "source_node_id": "encoder.up",
          "target_node_id": "encoder.gelu",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-24",
          "source_node_id": "encoder.gelu",
          "target_node_id": "encoder.down",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-25",
          "source_node_id": "add@encoder#0",
          "target_node_id": "add@encoder#1",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-26",
          "source_node_id": "encoder.down",
          "target_node_id": "add@encoder#1",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-27",
          "source_node_id": "input",
          "target_node_id": "patches.project",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-28",
          "source_node_id": "input",
          "target_node_id": "patches",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-29",
          "source_node_id": "class_token",
          "target_node_id": "python@TinyViT#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-30",
          "source_node_id": "input",
          "target_node_id": "python@TinyViT#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-31",
          "source_node_id": "python@TinyViT#0",
          "target_node_id": "cat@TinyViT#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-32",
          "source_node_id": "python@patches#0",
          "target_node_id": "cat@TinyViT#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-33",
          "source_node_id": "patches",
          "target_node_id": "cat@TinyViT#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-34",
          "source_node_id": "cat@TinyViT#0",
          "target_node_id": "add@TinyViT#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-35",
          "source_node_id": "positions",
          "target_node_id": "add@TinyViT#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-36",
          "source_node_id": "add@TinyViT#0",
          "target_node_id": "encoder.norm1",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-37",
          "source_node_id": "add@TinyViT#0",
          "target_node_id": "add@encoder#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-38",
          "source_node_id": "add@TinyViT#0",
          "target_node_id": "encoder",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-39",
          "source_node_id": "add@encoder#1",
          "target_node_id": "norm",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-40",
          "source_node_id": "encoder",
          "target_node_id": "norm",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-41",
          "source_node_id": "norm",
          "target_node_id": "head",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-42",
          "source_node_id": "head",
          "target_node_id": "output",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        }
      ],
      "inputs": [],
      "modules": [],
      "operations": [],
      "metadata": {}
    },
    "view": {
      "graph_id": "snapshot",
      "node_positions": {
        "input": {
          "x": 0,
          "y": 160
        },
        "patches": {
          "x": 340,
          "y": 160
        },
        "class_token": {
          "x": 680,
          "y": 160
        },
        "python@TinyViT#0": {
          "x": 1020,
          "y": 160
        },
        "cat@TinyViT#0": {
          "x": 1360,
          "y": 160
        },
        "positions": {
          "x": 1700,
          "y": 160
        },
        "add@TinyViT#0": {
          "x": 2040,
          "y": 160
        },
        "encoder": {
          "x": 2380,
          "y": 160
        },
        "norm": {
          "x": 2720,
          "y": 160
        },
        "head": {
          "x": 3060,
          "y": 160
        },
        "output": {
          "x": 3400,
          "y": 160
        },
        "patches.project": {
          "x": 24,
          "y": 214
        },
        "flatten@patches#0": {
          "x": 24,
          "y": 364
        },
        "python@patches#0": {
          "x": 24,
          "y": 514
        },
        "encoder.norm1": {
          "x": 24,
          "y": 214
        },
        "encoder.attention": {
          "x": 24,
          "y": 364
        },
        "add@encoder#0": {
          "x": 24,
          "y": 514
        },
        "encoder.norm2": {
          "x": 24,
          "y": 664
        },
        "encoder.up": {
          "x": 24,
          "y": 814
        },
        "encoder.gelu": {
          "x": 24,
          "y": 964
        },
        "encoder.down": {
          "x": 24,
          "y": 1114
        },
        "add@encoder#1": {
          "x": 24,
          "y": 1264
        },
        "encoder.attention.query": {
          "x": 24,
          "y": 214
        },
        "python@encoder.attention#0": {
          "x": 24,
          "y": 364
        },
        "encoder.attention.key": {
          "x": 24,
          "y": 514
        },
        "python@encoder.attention#1": {
          "x": 24,
          "y": 664
        },
        "div@encoder.attention#0": {
          "x": 24,
          "y": 814
        },
        "encoder.attention.value": {
          "x": 24,
          "y": 964
        },
        "python@encoder.attention#2": {
          "x": 24,
          "y": 1114
        },
        "encoder.attention.softmax": {
          "x": 24,
          "y": 1264
        },
        "encoder.attention.project": {
          "x": 24,
          "y": 1414
        }
      },
      "collapsed_modules": [
        "patches",
        "encoder",
        "encoder.attention"
      ],
      "selection": [],
      "layout": {}
    }
  },
  "snapshotId": "snapshot-b53e0e366a3d3e8c",
  "collaboration": {
    "walkthrough": {
      "title": "Turn an image into tokens",
      "steps": [
        {
          "id": "patches",
          "title": "Project non-overlapping RGB patches",
          "note": "A 4×4, stride-four convolution implements the same shared linear map as flattening each RGB patch. Sixteen patches each contain 48 input values and become 16-feature tokens.",
          "view": {
            "camera": {
              "x": 308.5,
              "y": -7.5,
              "z": 1.25
            },
            "nodePositions": {
              "input": {
                "x": 0,
                "y": 160
              },
              "patches": {
                "x": 340,
                "y": 160
              },
              "class_token": {
                "x": 680,
                "y": 160
              },
              "python@TinyViT#0": {
                "x": 1020,
                "y": 160
              },
              "cat@TinyViT#0": {
                "x": 1360,
                "y": 160
              },
              "positions": {
                "x": 1700,
                "y": 160
              },
              "add@TinyViT#0": {
                "x": 2040,
                "y": 160
              },
              "encoder": {
                "x": 2380,
                "y": 160
              },
              "norm": {
                "x": 2720,
                "y": 160
              },
              "head": {
                "x": 3060,
                "y": 160
              },
              "output": {
                "x": 3400,
                "y": 160
              },
              "patches.project": {
                "x": 24,
                "y": 214
              },
              "flatten@patches#0": {
                "x": 24,
                "y": 364
              },
              "python@patches#0": {
                "x": 24,
                "y": 514
              },
              "encoder.norm1": {
                "x": 24,
                "y": 214
              },
              "encoder.attention": {
                "x": 24,
                "y": 364
              },
              "add@encoder#0": {
                "x": 24,
                "y": 514
              },
              "encoder.norm2": {
                "x": 24,
                "y": 664
              },
              "encoder.up": {
                "x": 24,
                "y": 814
              },
              "encoder.gelu": {
                "x": 24,
                "y": 964
              },
              "encoder.down": {
                "x": 24,
                "y": 1114
              },
              "add@encoder#1": {
                "x": 24,
                "y": 1264
              },
              "encoder.attention.query": {
                "x": 24,
                "y": 214
              },
              "python@encoder.attention#0": {
                "x": 24,
                "y": 364
              },
              "encoder.attention.key": {
                "x": 24,
                "y": 514
              },
              "python@encoder.attention#1": {
                "x": 24,
                "y": 664
              },
              "div@encoder.attention#0": {
                "x": 24,
                "y": 814
              },
              "encoder.attention.value": {
                "x": 24,
                "y": 964
              },
              "python@encoder.attention#2": {
                "x": 24,
                "y": 1114
              },
              "encoder.attention.softmax": {
                "x": 24,
                "y": 1264
              },
              "encoder.attention.project": {
                "x": 24,
                "y": 1414
              }
            },
            "expandedModuleIds": [
              "patches"
            ],
            "selectedNodeIds": [
              "patches.project"
            ],
            "viewport": {
              "width": 1100,
              "height": 700
            }
          },
          "anchors": [
            {
              "target": {
                "kind": "node",
                "nodeId": "patches.project"
              },
              "snapshotId": "snapshot-b53e0e366a3d3e8c",
              "exportedAt": "2026-09-17T06:18:49.600088+00:00",
              "modelName": "TinyViT",
              "context": "{\"connections\":[\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"input\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"patches.project\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"patches.project\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"flatten@patches#0\\\",\\\"targetPort\\\":\\\"x\\\"}\"],\"contents\":[],\"node\":{\"id\":\"patches.project\",\"kind\":\"layer\",\"op\":\"Conv2d\",\"params\":{\"in_channels\":3,\"kernel_size\":4,\"out_channels\":16,\"stride\":4},\"parent\":\"patches\"}}"
            }
          ]
        },
        {
          "id": "position",
          "title": "Add a class token and learned positions",
          "note": "The learned class token precedes the sixteen image tokens. Seventeen position vectors are added so the encoder can distinguish patch locations. Without positions, reordering patches preserves the class output.",
          "view": {
            "camera": {
              "x": -1367.5,
              "y": 60,
              "z": 1.25
            },
            "nodePositions": {
              "input": {
                "x": 0,
                "y": 160
              },
              "patches": {
                "x": 340,
                "y": 160
              },
              "class_token": {
                "x": 680,
                "y": 160
              },
              "python@TinyViT#0": {
                "x": 1020,
                "y": 160
              },
              "cat@TinyViT#0": {
                "x": 1360,
                "y": 160
              },
              "positions": {
                "x": 1700,
                "y": 160
              },
              "add@TinyViT#0": {
                "x": 2040,
                "y": 160
              },
              "encoder": {
                "x": 2380,
                "y": 160
              },
              "norm": {
                "x": 2720,
                "y": 160
              },
              "head": {
                "x": 3060,
                "y": 160
              },
              "output": {
                "x": 3400,
                "y": 160
              },
              "patches.project": {
                "x": 24,
                "y": 214
              },
              "flatten@patches#0": {
                "x": 24,
                "y": 364
              },
              "python@patches#0": {
                "x": 24,
                "y": 514
              },
              "encoder.norm1": {
                "x": 24,
                "y": 214
              },
              "encoder.attention": {
                "x": 24,
                "y": 364
              },
              "add@encoder#0": {
                "x": 24,
                "y": 514
              },
              "encoder.norm2": {
                "x": 24,
                "y": 664
              },
              "encoder.up": {
                "x": 24,
                "y": 814
              },
              "encoder.gelu": {
                "x": 24,
                "y": 964
              },
              "encoder.down": {
                "x": 24,
                "y": 1114
              },
              "add@encoder#1": {
                "x": 24,
                "y": 1264
              },
              "encoder.attention.query": {
                "x": 24,
                "y": 214
              },
              "python@encoder.attention#0": {
                "x": 24,
                "y": 364
              },
              "encoder.attention.key": {
                "x": 24,
                "y": 514
              },
              "python@encoder.attention#1": {
                "x": 24,
                "y": 664
              },
              "div@encoder.attention#0": {
                "x": 24,
                "y": 814
              },
              "encoder.attention.value": {
                "x": 24,
                "y": 964
              },
              "python@encoder.attention#2": {
                "x": 24,
                "y": 1114
              },
              "encoder.attention.softmax": {
                "x": 24,
                "y": 1264
              },
              "encoder.attention.project": {
                "x": 24,
                "y": 1414
              }
            },
            "expandedModuleIds": [],
            "selectedNodeIds": [
              "positions"
            ],
            "viewport": {
              "width": 1100,
              "height": 700
            }
          },
          "anchors": [
            {
              "target": {
                "kind": "node",
                "nodeId": "positions"
              },
              "snapshotId": "snapshot-b53e0e366a3d3e8c",
              "exportedAt": "2026-09-17T06:18:49.600088+00:00",
              "modelName": "TinyViT",
              "context": "{\"connections\":[\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"positions\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"add@TinyViT#0\\\",\\\"targetPort\\\":\\\"x\\\"}\"],\"contents\":[],\"node\":{\"id\":\"positions\",\"kind\":\"layer\",\"op\":\"Parameter\",\"params\":{}}}"
            }
          ]
        },
        {
          "id": "attention",
          "title": "Let the class token consult every patch",
          "note": "The two unmasked attention heads each compare all seventeen tokens. The heatmap below shows head 0's class-to-patch weights; its separate self-weight completes a row that sums to one.",
          "view": {
            "camera": {
              "x": 308.5,
              "y": -1044,
              "z": 1.25
            },
            "nodePositions": {
              "input": {
                "x": 0,
                "y": 160
              },
              "patches": {
                "x": 340,
                "y": 160
              },
              "class_token": {
                "x": 680,
                "y": 160
              },
              "python@TinyViT#0": {
                "x": 1020,
                "y": 160
              },
              "cat@TinyViT#0": {
                "x": 1360,
                "y": 160
              },
              "positions": {
                "x": 1700,
                "y": 160
              },
              "add@TinyViT#0": {
                "x": 2040,
                "y": 160
              },
              "encoder": {
                "x": 2380,
                "y": 160
              },
              "norm": {
                "x": 2720,
                "y": 160
              },
              "head": {
                "x": 3060,
                "y": 160
              },
              "output": {
                "x": 3400,
                "y": 160
              },
              "patches.project": {
                "x": 24,
                "y": 214
              },
              "flatten@patches#0": {
                "x": 24,
                "y": 364
              },
              "python@patches#0": {
                "x": 24,
                "y": 514
              },
              "encoder.norm1": {
                "x": 24,
                "y": 214
              },
              "encoder.attention": {
                "x": 24,
                "y": 364
              },
              "add@encoder#0": {
                "x": 24,
                "y": 514
              },
              "encoder.norm2": {
                "x": 24,
                "y": 664
              },
              "encoder.up": {
                "x": 24,
                "y": 814
              },
              "encoder.gelu": {
                "x": 24,
                "y": 964
              },
              "encoder.down": {
                "x": 24,
                "y": 1114
              },
              "add@encoder#1": {
                "x": 24,
                "y": 1264
              },
              "encoder.attention.query": {
                "x": 24,
                "y": 214
              },
              "python@encoder.attention#0": {
                "x": 24,
                "y": 364
              },
              "encoder.attention.key": {
                "x": 24,
                "y": 514
              },
              "python@encoder.attention#1": {
                "x": 24,
                "y": 664
              },
              "div@encoder.attention#0": {
                "x": 24,
                "y": 814
              },
              "encoder.attention.value": {
                "x": 24,
                "y": 964
              },
              "python@encoder.attention#2": {
                "x": 24,
                "y": 1114
              },
              "encoder.attention.softmax": {
                "x": 24,
                "y": 1264
              },
              "encoder.attention.project": {
                "x": 24,
                "y": 1414
              }
            },
            "expandedModuleIds": [
              "encoder",
              "encoder.attention"
            ],
            "selectedNodeIds": [
              "encoder.attention.softmax"
            ],
            "viewport": {
              "width": 1100,
              "height": 700
            }
          },
          "anchors": [
            {
              "target": {
                "kind": "node",
                "nodeId": "encoder.attention.softmax"
              },
              "snapshotId": "snapshot-b53e0e366a3d3e8c",
              "exportedAt": "2026-09-17T06:18:49.600088+00:00",
              "modelName": "TinyViT",
              "context": "{\"connections\":[\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"div@encoder.attention#0\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"encoder.attention.softmax\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"encoder.attention.softmax\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"encoder.attention.project\\\",\\\"targetPort\\\":\\\"x\\\"}\"],\"contents\":[],\"node\":{\"id\":\"encoder.attention.softmax\",\"kind\":\"layer\",\"op\":\"Softmax\",\"params\":{},\"parent\":\"encoder.attention\"}}"
            }
          ]
        },
        {
          "id": "classify",
          "title": "Read the final class-token representation",
          "note": "After pre-normalized attention and GELU MLP residual branches, the class token is normalized and passed to a three-class head. The other tokens support that representation through attention.",
          "view": {
            "camera": {
              "x": -2727.5,
              "y": 60,
              "z": 1.25
            },
            "nodePositions": {
              "input": {
                "x": 0,
                "y": 160
              },
              "patches": {
                "x": 340,
                "y": 160
              },
              "class_token": {
                "x": 680,
                "y": 160
              },
              "python@TinyViT#0": {
                "x": 1020,
                "y": 160
              },
              "cat@TinyViT#0": {
                "x": 1360,
                "y": 160
              },
              "positions": {
                "x": 1700,
                "y": 160
              },
              "add@TinyViT#0": {
                "x": 2040,
                "y": 160
              },
              "encoder": {
                "x": 2380,
                "y": 160
              },
              "norm": {
                "x": 2720,
                "y": 160
              },
              "head": {
                "x": 3060,
                "y": 160
              },
              "output": {
                "x": 3400,
                "y": 160
              },
              "patches.project": {
                "x": 24,
                "y": 214
              },
              "flatten@patches#0": {
                "x": 24,
                "y": 364
              },
              "python@patches#0": {
                "x": 24,
                "y": 514
              },
              "encoder.norm1": {
                "x": 24,
                "y": 214
              },
              "encoder.attention": {
                "x": 24,
                "y": 364
              },
              "add@encoder#0": {
                "x": 24,
                "y": 514
              },
              "encoder.norm2": {
                "x": 24,
                "y": 664
              },
              "encoder.up": {
                "x": 24,
                "y": 814
              },
              "encoder.gelu": {
                "x": 24,
                "y": 964
              },
              "encoder.down": {
                "x": 24,
                "y": 1114
              },
              "add@encoder#1": {
                "x": 24,
                "y": 1264
              },
              "encoder.attention.query": {
                "x": 24,
                "y": 214
              },
              "python@encoder.attention#0": {
                "x": 24,
                "y": 364
              },
              "encoder.attention.key": {
                "x": 24,
                "y": 514
              },
              "python@encoder.attention#1": {
                "x": 24,
                "y": 664
              },
              "div@encoder.attention#0": {
                "x": 24,
                "y": 814
              },
              "encoder.attention.value": {
                "x": 24,
                "y": 964
              },
              "python@encoder.attention#2": {
                "x": 24,
                "y": 1114
              },
              "encoder.attention.softmax": {
                "x": 24,
                "y": 1264
              },
              "encoder.attention.project": {
                "x": 24,
                "y": 1414
              }
            },
            "expandedModuleIds": [],
            "selectedNodeIds": [
              "head"
            ],
            "viewport": {
              "width": 1100,
              "height": 700
            }
          },
          "anchors": [
            {
              "target": {
                "kind": "node",
                "nodeId": "head"
              },
              "snapshotId": "snapshot-b53e0e366a3d3e8c",
              "exportedAt": "2026-09-17T06:18:49.600088+00:00",
              "modelName": "TinyViT",
              "context": "{\"connections\":[\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"head\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"output\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"norm\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"head\\\",\\\"targetPort\\\":\\\"x\\\"}\"],\"contents\":[],\"node\":{\"id\":\"head\",\"kind\":\"layer\",\"op\":\"Linear\",\"params\":{\"in_features\":16,\"out_features\":3}}}"
            }
          ]
        }
      ]
    },
    "threads": [],
    "savedViews": [
      {
        "id": "patches",
        "title": "Project non-overlapping RGB patches",
        "note": "A 4×4, stride-four convolution implements the same shared linear map as flattening each RGB patch. Sixteen patches each contain 48 input values and become 16-feature tokens.",
        "view": {
          "camera": {
            "x": 308.5,
            "y": -7.5,
            "z": 1.25
          },
          "nodePositions": {
            "input": {
              "x": 0,
              "y": 160
            },
            "patches": {
              "x": 340,
              "y": 160
            },
            "class_token": {
              "x": 680,
              "y": 160
            },
            "python@TinyViT#0": {
              "x": 1020,
              "y": 160
            },
            "cat@TinyViT#0": {
              "x": 1360,
              "y": 160
            },
            "positions": {
              "x": 1700,
              "y": 160
            },
            "add@TinyViT#0": {
              "x": 2040,
              "y": 160
            },
            "encoder": {
              "x": 2380,
              "y": 160
            },
            "norm": {
              "x": 2720,
              "y": 160
            },
            "head": {
              "x": 3060,
              "y": 160
            },
            "output": {
              "x": 3400,
              "y": 160
            },
            "patches.project": {
              "x": 24,
              "y": 214
            },
            "flatten@patches#0": {
              "x": 24,
              "y": 364
            },
            "python@patches#0": {
              "x": 24,
              "y": 514
            },
            "encoder.norm1": {
              "x": 24,
              "y": 214
            },
            "encoder.attention": {
              "x": 24,
              "y": 364
            },
            "add@encoder#0": {
              "x": 24,
              "y": 514
            },
            "encoder.norm2": {
              "x": 24,
              "y": 664
            },
            "encoder.up": {
              "x": 24,
              "y": 814
            },
            "encoder.gelu": {
              "x": 24,
              "y": 964
            },
            "encoder.down": {
              "x": 24,
              "y": 1114
            },
            "add@encoder#1": {
              "x": 24,
              "y": 1264
            },
            "encoder.attention.query": {
              "x": 24,
              "y": 214
            },
            "python@encoder.attention#0": {
              "x": 24,
              "y": 364
            },
            "encoder.attention.key": {
              "x": 24,
              "y": 514
            },
            "python@encoder.attention#1": {
              "x": 24,
              "y": 664
            },
            "div@encoder.attention#0": {
              "x": 24,
              "y": 814
            },
            "encoder.attention.value": {
              "x": 24,
              "y": 964
            },
            "python@encoder.attention#2": {
              "x": 24,
              "y": 1114
            },
            "encoder.attention.softmax": {
              "x": 24,
              "y": 1264
            },
            "encoder.attention.project": {
              "x": 24,
              "y": 1414
            }
          },
          "expandedModuleIds": [
            "patches"
          ],
          "selectedNodeIds": [
            "patches.project"
          ],
          "viewport": {
            "width": 1100,
            "height": 700
          }
        },
        "anchors": [
          {
            "target": {
              "kind": "node",
              "nodeId": "patches.project"
            },
            "snapshotId": "snapshot-b53e0e366a3d3e8c",
            "exportedAt": "2026-09-17T06:18:49.600088+00:00",
            "modelName": "TinyViT",
            "context": "{\"connections\":[\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"input\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"patches.project\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"patches.project\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"flatten@patches#0\\\",\\\"targetPort\\\":\\\"x\\\"}\"],\"contents\":[],\"node\":{\"id\":\"patches.project\",\"kind\":\"layer\",\"op\":\"Conv2d\",\"params\":{\"in_channels\":3,\"kernel_size\":4,\"out_channels\":16,\"stride\":4},\"parent\":\"patches\"}}"
          }
        ]
      }
    ],
    "openingViewId": "patches"
  }
}
