mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-21 13:31:55 -05:00
[GH-ISSUE #1684] [TinyTorch] Answers already in module 1 #13544
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bdub-1 on GitHub (May 5, 2026).
Original GitHub issue: https://github.com/harvard-edge/cs249r_book/issues/1684
Module
01 Tensor
Type of Improvement
Code quality (refactor, style, consistency)
Description
The solutions were already implemented when I started module 1.
Proposed Solution
Remove the implementations from the working notebooks.
@Shashank-Tripathi-07 commented on GitHub (May 5, 2026):
The solutions you are seeing are in the source file (
src/01_tensor/01_tensor.py), which is the contributor-facing source of truth. The### BEGIN SOLUTION/### END SOLUTIONmarkers are intentional nbgrader annotations.When a student runs
tito src export, these blocks get stripped out to generate the student-facing notebook with empty stubs. The GitHub source view always shows the full implementation by design.To get the blank student version locally:
This generates the notebook in
modules/01_tensor/with only the TODO stubs visible. Not a bug, working as intended.@bdub-1 commented on GitHub (May 5, 2026):
Thanks for the response. I used the quick start guide to being my module. I also don't see any mention of the this in the docs unless I missed it during the setup instructions. When I run
tito --helpthere is noexportcommand that shows up.edit: I am following the student-learner role so I was confused why I am seeing the answers as my default. The TITO CLI module workflow page doesn't mention this either. I cannot get the blank version to generate so I am unsure if there actually is a bug. I saw a closed issue earlier of the same bug so I am wondering if the issue lingers
@Shashank-Tripathi-07 commented on GitHub (May 6, 2026):
This is a confirmed bug. When a student runs
tito module start 01, the CLI was generating the notebook by passing the rawsrc/01_tensor/01_tensor.pyfile directly to jupytext with no stripping step. Every### BEGIN SOLUTION/### END SOLUTIONblock was carried over intact into the student notebook, so all answers were already filled in from the start.The issue was in
_create_module_from_srcinsidetinytorch/tito/commands/module/workflow.py. The function's own docstring acknowledged this behavior:The fix strips those solution blocks in memory before conversion. The source files in
src/are never touched. A temp directory is used to hold the stripped version, jupytext converts it to a notebook, and the temp dir is cleaned up automatically. Students now receive blank stubs with TODO comments, as intended.PR: #1686
@Shashank-Tripathi-07 commented on GitHub (May 6, 2026):
Thanks for your attention to this bug @bdub-1 . I've made a PR and corrected this to make sure no future versions suffer from any problem like these !
We highly needed learner feedback for the project so that we can correct it further and better ! Thanks
@bdub-1 commented on GitHub (May 6, 2026):
Happy to help!