mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-04-28 07:07:38 -05:00
- Create professional examples directory showcasing TinyTorch as real ML framework - Add examples: XOR, MNIST, CIFAR-10, text generation, autograd demo, optimizer comparison - Fix import paths in exported modules (training.py, dense.py) - Update training module with autograd integration for loss functions - Add progressive integration tests for all 16 modules - Document framework capabilities and usage patterns This commit establishes the examples gallery that demonstrates TinyTorch works like PyTorch/TensorFlow, validating the complete framework.
36 lines
1011 B
Python
36 lines
1011 B
Python
"""
|
|
Export Tests for Module XX: [Module Name]
|
|
Template for testing module exports
|
|
"""
|
|
|
|
import pytest
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# Add project root to path
|
|
sys.path.insert(0, str(Path(__file__).parent.parent.parent))
|
|
|
|
|
|
class TestModuleExports:
|
|
"""Test that module components are properly exported."""
|
|
|
|
def test_main_class_import(self):
|
|
"""Test main class can be imported from correct location."""
|
|
# Example:
|
|
# from tinytorch.core.module import MainClass
|
|
# assert MainClass is not None
|
|
pass
|
|
|
|
def test_helper_functions_import(self):
|
|
"""Test helper functions are available."""
|
|
# Example:
|
|
# from tinytorch.utils.module import helper_function
|
|
# assert callable(helper_function)
|
|
pass
|
|
|
|
def test_module_constants(self):
|
|
"""Test module constants are exported."""
|
|
# Example:
|
|
# from tinytorch.core.module import DEFAULT_VALUE
|
|
# assert DEFAULT_VALUE is not None
|
|
pass |