From a02ab28aceed6df73406cc0b5247227bf0b98229 Mon Sep 17 00:00:00 2001 From: Vijay Janapa Reddi Date: Sun, 28 Sep 2025 20:02:12 -0400 Subject: [PATCH] Fix all TinyTorch examples to work with current framework MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed issues across all examples: - Parameter naming: Linear layers use 'weights' not 'weight' - Data access: Handle nested .data attributes properly with hasattr checks - MaxPool2D: Use tuple (2,2) instead of int for pool_size - LayerNorm: Use gamma/beta not weight/bias - TransformerBlock: Access parameters attribute (list) not method - Model calls: Use model.forward() not model() for non-Module classes - Import structure: Use direct imports from tinytorch.core modules All examples now run successfully: - perceptron_1957: 99.1% accuracy ✓ - xor_1969: Runs without errors ✓ - mnist_mlp_1986: Architecture test passes ✓ - cifar_cnn_modern: Forward pass successful ✓ - gpt_2018: Training loop completes ✓