docs: fix out_dtype signatures for bmm, mm, addmm, baddbmm#179182
docs: fix out_dtype signatures for bmm, mm, addmm, baddbmm#179182satishkc7 wants to merge 1 commit into
Conversation
These functions document out_dtype=None as an optional default, but passing None explicitly raises a TypeError at runtime. Show two explicit overloads instead: one without out_dtype and one with it as a required argument, consistent with the actual C++ dispatch behavior.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/179182
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ You can merge normally! (5 Unrelated Failures)As of commit 7aff08c with merge base c44b2f2 ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
UNSTABLE - The following jobs are marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
|
@claude review this PR |
|
Claude finished @mikaylagawarecki's task in 1m 25s —— View job Review of PR #179182
SummaryThis PR correctly fixes the documented signatures for The fix follows the established pattern used by Detailed FeedbackLooks good overall. The changes are consistent across all four functions, the One minor observation: Nit — the second overload blocks for LGTM — this is a clean, well-scoped docs fix. |
|
@claude use the pr-review skill to review this |
|
Claude finished @albanD's task in 2m 10s —— View job PR Review: #179182
SummaryClean docs fix that correctly addresses #172751. The previous signatures documented Code QualityThe formatting is correct and consistent across all four functions:
One observation worth noting:
Backward CompatibilityNo BC concerns — this is a docs-only change with no functional code modifications. RecommendationApprove This is a well-scoped, correct docs fix that follows established patterns. The changes accurately reflect the actual C++ dispatcher overload structure in |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Fixes #172751
Summary
torch.bmm,torch.mm,torch.addmm, andtorch.baddbmmdocumentout_dtype=Noneas the default value for that parameter. However, passingout_dtype=Noneexplicitly raises aTypeErrorat runtime because the C++ dispatcher resolves overloads structurally and does not acceptNonefor a dtype argument.As suggested by @albanD, this PR updates the docstrings to show two explicit signatures for each function:
out_dtype(the common case)out_dtypeas a required positional argument (when dtype casting is needed)This follows the existing pattern used for
torch.max,torch.min, and other functions with multiple overloads.Changes
torch/_torch_docs.py: updatedaddmm,baddbmm,bmm, andmmdocstringsTest plan
out_dtype=Noneremain in affected docstrings