Files
TinyTorch/modules/setup/setup_dev.ipynb
Vijay Janapa Reddi 9d5fc583b5 Simplify setup module to only display ASCII art
- Replace complex setup module with simple hello_tinytorch() function
- Keep only the ASCII art file (tinytorch_flame.txt) for visual appeal
- Simplify tests to just verify function runs and file exists
- Update README to reflect simplified purpose and usage
- Remove complex developer profiles and system info classes
- Focus on minimal introduction to TinyTorch workflow
2025-07-10 19:22:18 -04:00

153 lines
6.3 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"id": "8de2eafa",
"metadata": {},
"source": [
"# TinyTorch Setup Module\n",
"\n",
"Welcome to TinyTorch! This is your first module in the Machine Learning Systems course.\n",
"\n",
"This module simply displays our beautiful ASCII art to get you started."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "4d47a76e",
"metadata": {
"execution": {
"iopub.execute_input": "2025-07-10T23:21:19.056010Z",
"iopub.status.busy": "2025-07-10T23:21:19.055652Z",
"iopub.status.idle": "2025-07-10T23:21:19.073438Z",
"shell.execute_reply": "2025-07-10T23:21:19.072589Z"
},
"lines_to_next_cell": 1
},
"outputs": [],
"source": [
"import os\n",
"from pathlib import Path\n",
"\n",
"def hello_tinytorch():\n",
" \"\"\"Display the TinyTorch ASCII art\"\"\"\n",
" try:\n",
" # Get the directory containing this file\n",
" current_dir = Path(__file__).parent\n",
" art_file = current_dir / \"tinytorch_flame.txt\"\n",
" \n",
" if art_file.exists():\n",
" with open(art_file, 'r') as f:\n",
" ascii_art = f.read()\n",
" print(ascii_art)\n",
" print(\"Tiny🔥Torch\")\n",
" print(\"Build ML Systems from Scratch!\")\n",
" else:\n",
" print(\"🔥 TinyTorch 🔥\")\n",
" print(\"Build ML Systems from Scratch!\")\n",
" except NameError:\n",
" # Handle case when running in notebook where __file__ is not defined\n",
" try:\n",
" art_file = Path(os.getcwd()) / \"tinytorch_flame.txt\"\n",
" if art_file.exists():\n",
" with open(art_file, 'r') as f:\n",
" ascii_art = f.read()\n",
" print(ascii_art)\n",
" print(\"Tiny🔥Torch\")\n",
" print(\"Build ML Systems from Scratch!\")\n",
" else:\n",
" print(\"🔥 TinyTorch 🔥\")\n",
" print(\"Build ML Systems from Scratch!\")\n",
" except:\n",
" print(\"🔥 TinyTorch 🔥\")\n",
" print(\"Build ML Systems from Scratch!\")"
]
},
{
"cell_type": "markdown",
"id": "885e6df3",
"metadata": {},
"source": [
"## Test the Setup\n",
"\n",
"Let's run our hello function to see the ASCII art:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "bfe5bac0",
"metadata": {
"execution": {
"iopub.execute_input": "2025-07-10T23:21:19.077086Z",
"iopub.status.busy": "2025-07-10T23:21:19.076813Z",
"iopub.status.idle": "2025-07-10T23:21:19.080935Z",
"shell.execute_reply": "2025-07-10T23:21:19.080437Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
". . ... ....... .... ... . . .. .... . .. . . . . . .... \n",
". . .. .++. .. . . . .. ... . . . .. ... .. \n",
" . . . .=++=.. . . . .. . . .. . ... .. . . \n",
". .. ... .++++=. . . . . .. . .. .\n",
". . . . ....-+++++.... ... .. . .... .. . . . . . . . . . . . . \n",
" . .. ...-++++++-...... .. . ..... ..-:.. .. . .... .. . . .. . .. . . . \n",
" .. .. ..++++++++-.. . . ..##... -%#. . . . . . \n",
". .. .:+++++++++.... ... . ...:%%:............:-:. ..... ...... . . ....... .. . . \n",
" ..+++++++++++. ... . .. .=#%%##+.-##..#%####%%=.=%%. .*%+.. . . . ... \n",
" . ..++++++++++++...-++..... . .%%... -##..##=...=%#..*%*..=%#.. . .. ... . . . . .. . ...\n",
" ..-+++++++++++++..=++++... .....%#.. -##..#%-.. -##. .%%=.%%.. . . . . . ... .\n",
". .=++++++++++++++-+++++++.... . ...%%:...-##..#%-. .-%#. ..#%#%=.. . .. ... . . . .\n",
"..=+++++++++++++++++++++++-. . ..=%%%+.-%#..##-. .-%#....-%%*.. . .. . .. .. .. \n",
".:+++++++++++=+++++++++++++. . ................ .......-%%... . .. . . .. . \n",
".++++++++++===+++++++++++++: . .................... . ...%%%#:........ . .. ..... ......... ....\n",
":+++++++++====+++++++++++++=.. ...-----------.....-+#*=:.....-------:.......:=*#+-.. ..--:.....--=.\n",
":++++++++======++++++++++++=.. ...#%%%%%%%%%#..-#%%###%%#=...#%####%%%=...+%%%###%%#...#%+.. ..#%%.\n",
".+++++++========+++++++++++- .. .#%%.. ..-%%+.. ..-%%+..#%*.. .*%%..*%%:. ..#%*..#%+... .#%%.\n",
".=++++++==========+++++++++: . .#%%.....#%#.... .*%#..#%*...-%%*..#%+. ... . ..##%#####%%%.\n",
"..++++++===========+++++++-. . ...#%%. . .#%#. . .*%#..#%%%%%%#-. .#%+. . ....#%*-----#%%.\n",
"...+++++===========++++++=. . . . .#%%... -%%+.....=%%+..#%*..+%%-. .*%%-.....#%*..%%+.. ..%%%.\n",
". ..-+++===========+++++.. . .. ..#%%. .:%%%###%%%=...#%*...+%%=...+%%####%%#...%%+.. ..%%%.\n",
" . ...-++==========+++:.... ... . .===. ... ..-+++=.. ..-=-....-==: ..:=+++-.. ..==-... .===.\n",
" ....-+=======+-...... .. . . ... . . .. ... . . .... . . . . ..... . ... ..... .\n",
" .... . ......:..... ... . .. . ... . . ... . . . ... . . . ... .. ..... . . \n",
"\n",
"Tiny🔥Torch\n",
"Build ML Systems from Scratch!\n"
]
}
],
"source": [
"if __name__ == \"__main__\":\n",
" hello_tinytorch()"
]
}
],
"metadata": {
"jupytext": {
"cell_metadata_filter": "-all",
"main_language": "python",
"notebook_metadata_filter": "-all"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.19"
}
},
"nbformat": 4,
"nbformat_minor": 5
}