tinytorch/binder/README.md
This directory contains configuration files for running TinyTorch in cloud environments via Binder and Google Colab.
requirements.txt: Python dependencies for the Binder environmentpostBuild: Script that runs after environment setup to install TinyTorchWhen users click the "Launch Binder" button on any notebook page in the TinyTorch documentation:
binder/requirements.txt to install Python dependenciesbinder/postBuild which:
pip install -e .)src/*.py files using Jupytextmodules/ with ready-to-use Jupyter notebooksNote: The modules/ directory is gitignored because notebooks are generated from the source .py files. This ensures students always get notebooks that match the current code.
Binder URL Format:
https://mybinder.org/v2/gh/harvard-edge/cs249r_book/main
Colab launch buttons automatically:
binder/requirements.txtpip install -e .)Colab URL Format:
https://colab.research.google.com/github/harvard-edge/cs249r_book/blob/main/tinytorch/path/to/notebook.ipynb
To test your Binder setup:
Test Binder Build:
# Visit: https://mybinder.org/v2/gh/harvard-edge/cs249r_book/main
# Or use the badge:
[](https://mybinder.org/v2/gh/harvard-edge/cs249r_book/main)
Verify Installation: Once Binder launches, test in a notebook:
import tinytorch
print(tinytorch.__version__)
Check Available Resources:
import os
print("Modules:", os.listdir("modules"))
print("Assignments:", os.listdir("assignments"))
print("Milestones:", os.listdir("milestones"))
binder/requirements.txt for syntax errorsbinder/postBuild has execute permissions (chmod +x binder/postBuild)binder/requirements.txt includes all dependencies!pip install -e . in a Colab cellpostBuild script runs pip install -e . correctlypyproject.toml is in the repository rootrequirements.txt are compatibleAs documented in the TinyTorch paper, three deployment environments are supported:
JupyterHub (institutional server)
Google Colab (zero installation)
Local Installation (pip install tinytorch)
When updating dependencies:
requirements.txt (root) - for local developmentbinder/requirements.txt - for Binder/Colabdocs/requirements.txt - for documentation builds