Loading...
Loading...
Review PyTorch pull requests for code quality, test coverage, security, and backward compatibility. Use when reviewing PRs, when asked to review code changes, or when the user mentions "review PR", "code review", or "check this PR".
npx skill4agent add pytorch/pytorch pr-review/pr-reviewWhat would you like me to review?
- A PR number or URL (e.g.,
)/pr-review 12345- A local branch (e.g.,
)/pr-review branch
/pr-review 12345
/pr-review https://github.com/pytorch/pytorch/pull/12345/pr-review 12345 detailedgh# Get PR details
gh pr view <PR_NUMBER> --json title,body,author,baseRefName,headRefName,files,additions,deletions,commits
# Get the diff
gh pr diff <PR_NUMBER>
# Get PR comments
gh pr view <PR_NUMBER> --json comments,reviewsmain/pr-review branch
/pr-review branch detailed# Get current branch name
git branch --show-current
# Get list of changed files compared to main
git diff --name-only main...HEAD
# Get full diff compared to main
git diff main...HEAD
# Get commit log for the branch
git log main..HEAD --oneline
# Get diff stats (files changed, insertions, deletions)
git diff --stat main...HEADgh| Area | Focus | Reference |
|---|---|---|
| Code Quality | Abstractions, patterns, complexity | review-checklist.md |
| API Design | New patterns, flag-based access, broader implications | review-checklist.md |
| Testing | Coverage, patterns, edge cases | review-checklist.md |
| Security | Injection, credentials, input handling | review-checklist.md |
| Performance | Regressions, device handling, memory | review-checklist.md |
| Thread Safety | Data races, GIL assumptions, NoGIL, CPython C API | review-checklist.md |
| BC | Breaking changes, deprecation | bc-guidelines.md |
## PR Review: #<number>
<!-- Or for local branch reviews: -->
## Branch Review: <branch-name> (vs main)
### Summary
Brief overall assessment of the changes (1-2 sentences).
### Code Quality
[Issues and suggestions, or "No concerns" if none]
### API Design
[Flag new patterns, internal-access flags, or broader implications if any. Otherwise omit this section.]
### Testing
- [ ] Tests exist for new functionality
- [ ] Edge cases covered
- [ ] Tests follow PyTorch patterns (TestCase, assertEqual)
[Additional testing feedback]
### Security
[Issues if any, or "No security concerns identified"]
### Thread Safety
[Threading concerns if any, or "No thread safety concerns"]
### Backward Compatibility
[BC concerns if any, or "No BC-breaking changes"]
### Performance
[Performance concerns if any, or "No performance concerns"]
### Recommendation
**Approve** / **Request Changes** / **Needs Discussion**
[Brief justification for recommendation]### Specific Comments
- `src/module.py:42` - Consider extracting this logic into a named function for clarity
- `test/test_feature.py:100-105` - Missing test for error case when input is None
- `torch/nn/modules/linear.py:78` - This allocation could be moved outside the loopCLAUDE.mdCONTRIBUTING.mdtorch/testing/_internal/common_utils.pytorch/testing/_internal/opinfo/core.py