mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-06-01 01:47:54 -05:00
Fix all TinyTorch examples to work with current framework
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 ✓
This commit is contained in: