Views
No views yet
x7 ─┬─[XOR]─┐
x6 ─┘ ├─[XOR]─┐
x5 ─┬─[XOR]─┘ │
x4 ─┘ ├─[XOR]──► parity
x3 ─┬─[XOR]─┐ │
x2 ─┘ ├─[XOR]─┘
x1 ─┬─[XOR]─┘
x0 ─┘Linear chain (depth 7):
x0─[XOR]─[XOR]─[XOR]─[XOR]─[XOR]─[XOR]─[XOR]─► parity
x1 x2 x3 x4 x5 x6 x7
Tree structure (depth 3):
Layer 1: 4 parallel XORs
Layer 2: 2 parallel XORs
Layer 3: 1 final XOR| Layer | XOR Gates | Function |
|---|---|---|
| 1 | 4 | Pairs: (0,1), (2,3), (4,5), (6,7) |
| 2 | 2 | Pairs: (01,23), (45,67) |
| 3 | 1 | Final: (0123,4567) |
| Bits | Tree Depth | Linear Depth |
|---|---|---|
| 8 | 3 | 7 |
| 16 | 4 | 15 |
| 32 | 5 | 31 |
| 64 | 6 | 63 |
1from safetensors.torch import load_file
2
3w = load_file('model.safetensors')
4
5# Examples:
6# 0x00 (00000000) → parity=0
7# 0x01 (00000001) → parity=1
8# 0x03 (00000011) → parity=0
9# 0xFF (11111111) → parity=0threshold-parity-tree/
├── model.safetensors
├── create_safetensors.py
├── config.json
└── README.md