feat: Add consistent 'Where This Code Lives' template across modules

- Add template section to tensor, layers, activations, and cnn modules
- Create docs/development/module-template.md for future reference
- Clarify learning vs building structure consistently
- Show students where their code will live in the final package
- Decouple learning modules from production organization
This commit is contained in:
Vijay Janapa Reddi
2025-07-10 23:48:49 -04:00
parent 38cac60aff
commit eebb22ebdb
5 changed files with 130 additions and 10 deletions

View File

@@ -20,12 +20,27 @@ Welcome to the Tensor module! This is where TinyTorch really begins. You'll impl
- Handle shape management, data types, and memory layout
- Build the foundation for neural networks and automatic differentiation
## Module → Package Structure
**🎓 Teaching vs. 🔧 Building**:
- **Learning side**: Work in `modules/tensor/tensor_dev.py`
- **Building side**: Exports to `tinytorch/core/tensor.py`
"""
This module builds the core data structure that all other TinyTorch components will use.
# %% [markdown]
"""
## 📦 Where This Code Lives in the Final Package
**Learning Side:** You work in `modules/tensor/tensor_dev.py`
**Building Side:** Code exports to `tinytorch.core.tensor`
```python
# Final package structure:
from tinytorch.core.tensor import Tensor
from tinytorch.core.layers import Dense, Conv2D
from tinytorch.core.activations import ReLU, Sigmoid, Tanh
```
**Why this matters:**
- **Learning:** Focused modules for deep understanding
- **Production:** Proper organization like PyTorch's `torch.tensor`
- **Consistency:** Core data structure lives in `core.tensor`
"""
"""
# %%