Skip to content

Instantly share code, notes, and snippets.

@mplekh
mplekh / tapegpt.py
Last active March 12, 2026 00:43
Karpathy's microgpt modified to use Wengert Tape architecture (Flat Array of Values instead of Graph of Objects)
import math
import random
random.seed(42)
# -----------------------------------------------------------------------------
# Tape-based Autograd Engine
# -----------------------------------------------------------------------------
class Tape: