Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
/textPublic archive

Fix docstring mistakes in bundler.py#2265

Open
yulonglin wants to merge1 commit intopytorch:main
base:main
Choose a base branch
Loading
fromyulonglin:patch-1

Conversation

yulonglin
Copy link

The output dimensions for one of the examples is wrong, since the batch size is 2, not 1. Further, there is no need to import RobertaClassificationHead for that example, as it is later accessed viatorchtext.models.RobertaClassificationHead

How to reproduce the issue

Run the following:

>>>importtorch,torchtext>>>fromtorchtext.modelsimportRobertaClassificationHead>>>fromtorchtext.functionalimportto_tensor>>>xlmr_large=torchtext.models.XLMR_LARGE_ENCODER>>>classifier_head=torchtext.models.RobertaClassificationHead(num_classes=2,input_dim=1024)>>>model=xlmr_large.get_model(head=classifier_head)>>>transform=xlmr_large.transform()>>>input_batch= ["Hello world","How are you!"]>>>model_input=to_tensor(transform(input_batch),padding_value=1)>>>output=model(model_input)>>>output.shape

Expected result

torch.Size([2, 2])

Result given in docstring

torch.Size([1, 2])

The output dimensions for one of the examples is wrong, since the batch size is 2, not 1. Further, there is no need to import RobertaClassificationHead for that example, as it is accessed via torchtext.models.RobertaClassificationHead
@pytorch-botPyTorch Bot
Copy link

🔗 Helpful Links

🧪 See artifacts and rendered test results athud.pytorch.org/pr/pytorch/text/2265

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@yulonglin@facebook-github-bot

[8]ページ先頭

©2009-2025 Movatter.jp