Files
TinyTorch/modules/source
Vijay Janapa Reddi 611e5cdb5a Fix bias shape corruption in optimizers with proper workflow
CRITICAL FIXES:
- Fixed Adam & SGD optimizers corrupting parameter shapes with variable batch sizes
- Root cause: param.data = Tensor() created new tensor with wrong shape
- Solution: Use param.data._data[:] = ... to preserve original shape

CLAUDE.md UPDATES:
- Added CRITICAL RULE: Never modify core files directly
- Established mandatory workflow: Edit source → Export → Test
- Clear consequences for violations to prevent source/compiled mismatch

TECHNICAL DETAILS:
- Source fix in modules/source/10_optimizers/optimizers_dev.py
- Temporary fix in tinytorch/core/optimizers.py (needs proper export)
- Preserves parameter shapes across all batch sizes
- Enables variable batch size training without broadcasting errors

VALIDATION:
- Created comprehensive test suite validating shape preservation
- All optimizer tests pass with arbitrary batch sizes
- Ready for CIFAR-10 training with variable batches
2025-09-21 11:34:52 -04:00
..