Skip to content

fix(torch-stubs): add nn.Module.extra_repr stub - #4914

Closed
yeetypete wants to merge 1 commit into
facebook:mainfrom
yeetypete:torch-stubs-module-extra-repr
Closed

yeetypete wants to merge 1 commit into
facebook:mainfrom
yeetypete:torch-stubs-module-extra-repr

Conversation

@yeetypete

@yeetypete yeetypete commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

We add a stub for nn.Module.extra_repr, which was previously missing. Without it, overriding extra_repr in a subclass reported bad-override. See
https://github.com/pytorch/pytorch/blob/d6c03540dc0f040e1d8a920d19d9333de6513545/torch/nn/modules/module.py#L2997

Test Plan

Run test.py.

@yeetypete
yeetypete force-pushed the torch-stubs-module-extra-repr branch from 161f868 to 63808d1 Compare September 12, 2026 10:25
@github-actions github-actions Bot added size/s and removed size/s labels Sep 12, 2026
@meta-codesync

meta-codesync Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D119799534. (Because this pull request was imported automatically, there will not be any future comments.)

@stroxler stroxler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync Bot closed this in 2dc9e3a Sep 14, 2026
@meta-codesync meta-codesync Bot added the Merged label Sep 14, 2026
@meta-codesync

meta-codesync Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

This pull request has been merged in 2dc9e3a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants