Fix step activation docstring to match >= threshold behavior - #3902
Open
ayaangazali wants to merge 1 commit into
Open
Fix step activation docstring to match >= threshold behavior#3902ayaangazali wants to merge 1 commit into
ayaangazali wants to merge 1 commit into
Conversation
ayaangazali
force-pushed
the
fix-step-docstring
branch
from
August 1, 2026 07:37
0caef17 to
be3358f
Compare
Contributor
Author
|
Gentle nudge on three small docstring PRs that have been sitting: this one, #3903 and #3906. Each is a one or two line correction where the text disagrees with the code right next to it:
I rebased all three on current main just now and they are green. No rush from my side. Happy to squash them into one PR if that is easier to review, or to close any of them if you would rather not take the change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
The
stepfunction andStepmodule docstrings say the output is "1 if the input is greater than a specified threshold", but the implementation ismx.where(x >= threshold, 1, 0)and the math block right below the prose already usesx >= threshold. So the prose was the only part that disagreed. Quick check on main:Updated the prose to "greater than or equal to" in both places, and documented the
thresholddefault (0.0) while I was there.Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes(docstring-only, test_nn.py still passes 69/69)
quick note: i'm a freshman still learning, and i lean on Claude Code to surface these doc/code mismatches, but i ran the snippet above myself to confirm the boundary value maps to 1 before writing this. happy to adjust if you'd word it differently.