Files
TinyTorch/modules
Vijay Janapa Reddi aec4384c5d Fix all remaining modules to prevent test execution on import
Wrapped test code in if __name__ == '__main__': guards for:
- Module 02 (activations): 7 test calls protected
- Module 03 (layers): 7 test calls protected
- Module 04 (losses): 10 test calls protected
- Module 05 (autograd): 7 test calls protected
- Module 06 (optimizers): 8 test calls protected
- Module 07 (training): 7 test calls protected
- Module 09 (spatial): 5 test calls protected

Impact:
- All modules can now be imported cleanly without test execution
- Tests still run when modules are executed directly
- Clean dependency chain throughout the framework
- Follows Python best practices for module structure

This completes the fix for the entire module system. Modules can now
properly import from each other without triggering test code execution.
2025-09-30 06:40:45 -04:00
..