Repository navigation
β¨ Feature Release
This release addresses two major limitations from v1.0.0 and enhances core tensor operations.
π§ Fixed
Broadcasting Gradient Reduction - Fixed incorrect gradient computation when broadcasting occurs in forward pass:
add_backward(): Now correctly reduces gradients when shapes differ (e.g.,[3,1] + [3,4])mul_backward(): Now correctly reduces gradients when shapes differ (e.g.,[3,1] * [3,4])matmul_backward(): Fixed two critical bugs:- Transpose now only swaps matrix dimensions (last 2), not batch dimensions
- Added gradient reduction for batch broadcasting (e.g.,
[1,3,4] @ [2,4,5])
- Added
reduce_grad_for_broadcast()helper function
β Added
Enhanced Slice Functionality - Full NumPy-compatible slicing with reverse support:
tofu_tensor_arange(): Now supports negative steps for reverse slicingtofu_tensor_rearange(): Now supports negative steps for reverse slicing- Examples:
arange(10, 0, -1)β[10, 9, 8, ..., 1]βarange(5, 5, 1)β NULL (empty range) βarange(0, 10, -1)β NULL (incompatible step) β
Comprehensive Test Suites:
test/standalone/test_broadcast_gradient.c: 5 broadcast gradient teststest/standalone/test_arange_enhanced.c: 6 test categories with 18+ tests
π Testing
- β All 66 unit tests pass
- β Phase 1 validation (gradient correctness)
- β Phase 2 validation (architecture)
- β Phase 3 validation (classification & regression)
- β 23+ new tests for enhanced functionality
π Performance
- No performance regressions
- Minimal overhead for gradient reduction (only when broadcasting occurs)
π Documentation
- Updated README with v1.1.0 announcement
- Enhanced mdBook user guide with reverse slicing examples
- Updated Doxygen API comments for arange/rearange functions
- Comprehensive CHANGELOG entry
π Links
Upgrade Note: This release is fully backward compatible with v1.0.0. No breaking changes.