mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-05-08 00:07:34 -05:00
✅ Fix 02_tensor: Correct pattern - Tests → STANDARDIZED MODULE TESTING → Module Summary
CORRECT PATTERN NOW: 1. ✅ Unit tests (test_unit_tensor_creation, test_unit_tensor_properties, test_unit_tensor_arithmetic) 2. ✅ ## 🧪 Module Testing 3. ✅ STANDARDIZED MODULE TESTING cell 4. ✅ run_module_tests_auto call 5. ✅ ## 🎯 Module Summary (immediately after, no code between) ✅ Moved test functions from after run_module_tests_auto to before ## 🧪 Module Testing ✅ Removed duplicate test functions from wrong location ✅ Clean separation: Tests → Testing → Summary ✅ No code between STANDARDIZED MODULE TESTING and Module Summary
This commit is contained in:
@@ -815,27 +815,6 @@ Congratulations! You've successfully implemented the core Tensor class for TinyT
|
||||
**Ready for the next challenge?** Let's add the mathematical functions that make neural networks powerful!
|
||||
"""
|
||||
|
||||
# %% [markdown]
|
||||
"""
|
||||
## 🧪 Module Testing
|
||||
|
||||
Time to test your implementation! This section uses TinyTorch's standardized testing framework to ensure your implementation works correctly.
|
||||
|
||||
**This testing section is locked** - it provides consistent feedback across all modules and cannot be modified.
|
||||
"""
|
||||
|
||||
# %% nbgrader={"grade": false, "grade_id": "standardized-testing", "locked": true, "schema_version": 3, "solution": false, "task": false}
|
||||
# =============================================================================
|
||||
# STANDARDIZED MODULE TESTING - DO NOT MODIFY
|
||||
# This cell is locked to ensure consistent testing across all TinyTorch modules
|
||||
# =============================================================================
|
||||
|
||||
if __name__ == "__main__":
|
||||
from tito.tools.testing import run_module_tests_auto
|
||||
|
||||
# Automatically discover and run all tests in this module
|
||||
success = run_module_tests_auto("Tensor")
|
||||
|
||||
# %%
|
||||
def test_unit_tensor_creation():
|
||||
"""Comprehensive test of tensor creation with all data types and shapes."""
|
||||
@@ -903,6 +882,27 @@ def test_unit_tensor_arithmetic():
|
||||
assert np.allclose(f.data, expected)
|
||||
print("✅ Tensor arithmetic tests passed!")
|
||||
|
||||
# %% [markdown]
|
||||
"""
|
||||
## 🧪 Module Testing
|
||||
|
||||
Time to test your implementation! This section uses TinyTorch's standardized testing framework to ensure your implementation works correctly.
|
||||
|
||||
**This testing section is locked** - it provides consistent feedback across all modules and cannot be modified.
|
||||
"""
|
||||
|
||||
# %% nbgrader={"grade": false, "grade_id": "standardized-testing", "locked": true, "schema_version": 3, "solution": false, "task": false}
|
||||
# =============================================================================
|
||||
# STANDARDIZED MODULE TESTING - DO NOT MODIFY
|
||||
# This cell is locked to ensure consistent testing across all TinyTorch modules
|
||||
# =============================================================================
|
||||
|
||||
if __name__ == "__main__":
|
||||
from tito.tools.testing import run_module_tests_auto
|
||||
|
||||
# Automatically discover and run all tests in this module
|
||||
success = run_module_tests_auto("Tensor")
|
||||
|
||||
# %% [markdown]
|
||||
"""
|
||||
## 🎯 Module Summary: Tensor Foundation Mastery!
|
||||
|
||||
Reference in New Issue
Block a user