mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-05-06 09:22:31 -05:00
🎯 Issues Fixed: 1. Conv2D Layer: Made polymorphic to preserve input tensor types (MockTensor compatibility) 2. Flatten Function: Made polymorphic to return same type as input tensor 3. Type Signatures: Updated method signatures to be flexible (remove Tensor type annotations) ✅ Impact: 05_cnn external tests now pass 35/35 (was 31/35) 🔧 Technical Changes: - Conv2D.forward(): return type(x)(result) instead of Tensor(result) - flatten(): return type(x)(result) instead of Tensor(result) - Updated method signatures: forward(self, x) instead of forward(self, x: Tensor) -> Tensor - Consistent polymorphic pattern across all CNN components This resolves the MockTensor vs Tensor compatibility issues, making CNN components work with external testing frameworks.