Files
TinyTorch/modules/setup
Vijay Janapa Reddi 04d6744138 Add notebook compatibility and execute setup_dev.ipynb
🔧 Notebook Compatibility:
- Fix __file__ NameError in notebook environment
- Add try/except for file path detection
- Handle both script and notebook execution contexts
- Use os.getcwd() fallback when __file__ not available

📓 Notebook Execution:
- Execute setup_dev.ipynb with all outputs generated
- Beautiful ASCII art displays properly in notebook
- All test cells show expected results
- Student-friendly interactive experience

🎨 ASCII Art Display:
- Stunning flame ASCII art renders perfectly in notebook
- Full profile display with Tiny🔥Torch branding
- Interactive testing cells with clear outputs
- Students can see the ASCII art immediately

🧪 Testing:
- All 17 tests still pass after notebook conversion
- File loading works in both environments
- Comprehensive coverage maintained
- Ready for student use

Students can now run the setup_dev.ipynb notebook and immediately see the beautiful ASCII art output, making their first TinyTorch experience memorable and engaging
2025-07-10 19:19:22 -04:00
..

Module 0: Setup

Learning Objectives

This module teaches you the TinyTorch development workflow. By the end, you'll be comfortable with:

  • Writing code in Jupyter notebooks using nbdev conventions
  • Exporting notebook code to Python modules
  • Running tests and using the TinyTorch CLI
  • Understanding the development rhythm you'll use for all modules

What You'll Build

A simple "Hello World" system that demonstrates the complete development cycle:

  • Basic utility functions
  • A simple SystemInfo class
  • Tests to verify everything works
  • Experience with the full notebook → export → test workflow

Module Structure

modules/setup/
├── setup_dev.ipynb        # 📓 Main development notebook
├── README.md              # 📖 This guide
└── __init__.py            # 📦 Module marker

Development Workflow

1. Work in the Notebook

cd modules/setup
jupyter lab setup_dev.ipynb

2. Export Your Code

python bin/tito.py sync

3. Test Your Implementation

python bin/tito.py test --module setup

4. Check Your Progress

python bin/tito.py info

Key Concepts

  • nbdev workflow: Write in notebooks, export to Python
  • Export directive: Use #| export to mark code for export
  • Module → Package mapping: This module exports to tinytorch/core/utils.py
  • Teaching vs. Building: Learn by modules, build by function (see VISION.md)
  • Test integration: Tests run automatically via CLI
  • Module development: Each module is self-contained

Success Criteria

All tests pass
Code exports cleanly to tinytorch/core/utils.py
You understand the development rhythm
Ready to tackle the Tensor module


Next Module: Tensor - Core data structures and operations