From ca6515efaeda866c60f7ac4144fe96205d51588e Mon Sep 17 00:00:00 2001 From: Vijay Janapa Reddi Date: Sun, 20 Jul 2025 09:25:38 -0400 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Fix=2002=5Ftensor:=20Correct=20patt?= =?UTF-8?q?ern=20-=20Tests=20=E2=86=92=20STANDARDIZED=20MODULE=20TESTING?= =?UTF-8?q?=20=E2=86=92=20Module=20Summary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- modules/source/02_tensor/tensor_dev.py | 42 +++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/modules/source/02_tensor/tensor_dev.py b/modules/source/02_tensor/tensor_dev.py index b518ab01..2c318708 100644 --- a/modules/source/02_tensor/tensor_dev.py +++ b/modules/source/02_tensor/tensor_dev.py @@ -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!