Skip to content

Conversation

@vishalgoyal316
Copy link
Contributor

Validates that input_size is an int > 0, providing clear TypeError/ValueError instead of cryptic torch.empty() errors. Applies to nn.RNN, nn.LSTM, nn.GRU.

Fixes #136936

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 27, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/166302

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

✅ No Failures

As of commit e22e1db with merge base 6b25a63 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@soulitzer soulitzer added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Oct 28, 2025
@albanD albanD removed their request for review November 27, 2025 00:09
test/test_nn.py Outdated
with self.assertRaisesRegex(ValueError, error_msg):
rnn = getattr(nn, mode)(30, 20, 2, proj_size=10)

def test_rnn_invalid_input_size_and_hidden_size(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar ErrorModuleInput comment

@vishalgoyal316
Copy link
Contributor Author

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Successfully rebased issue_136936 onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout issue_136936 && git pull --rebase)

@vishalgoyal316
Copy link
Contributor Author

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Successfully rebased issue_136936 onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout issue_136936 && git pull --rebase)

@vishalgoyal316
Copy link
Contributor Author

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Tried to rebase and push PR #166302, but it was already up to date. Try rebasing against main by issuing:
@pytorchbot rebase -b main

@vishalgoyal316
Copy link
Contributor Author

@pytorchbot rebase -b main

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/main. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Rebase failed due to Command git -C /home/runner/work/pytorch/pytorch rebase refs/remotes/origin/main pull/166302/head returned non-zero exit code 1

Rebasing (1/1)
Auto-merging torch/nn/modules/rnn.py
CONFLICT (content): Merge conflict in torch/nn/modules/rnn.py
error: could not apply 5f9df9f7535... [nn] Add input_size validation for RNN modules with clear error messages
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Could not apply 5f9df9f7535... # [nn] Add input_size validation for RNN modules with clear error messages

Raised by https://github.com/pytorch/pytorch/actions/runs/20140673671

@vishalgoyal316 vishalgoyal316 marked this pull request as draft December 11, 2025 17:32
@vishalgoyal316 vishalgoyal316 marked this pull request as ready for review December 11, 2025 17:36
Copy link
Contributor

@mikaylagawarecki mikaylagawarecki left a comment

Choose a reason for hiding this comment

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

Thanks

@mikaylagawarecki
Copy link
Contributor

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Dec 15, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / linux-jammy-cuda12.8-py3.10-gcc11-no-ops / build

Details for Dev Infra team Raised by workflow job

@mikaylagawarecki
Copy link
Contributor

@pytorchbot merge -r

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

Validates that input_size is an int > 0, providing clear TypeError/ValueError
instead of cryptic torch.empty() errors. Applies to nn.RNN, nn.LSTM, nn.GRU.

Tests added via ErrorModuleInput in module_error_inputs_torch_nn_RNN_GRU()
in common_modules.py for comprehensive validation coverage.

Fixes pytorch#136936
@pytorchmergebot
Copy link
Collaborator

Successfully rebased issue_136936 onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout issue_136936 && git pull --rebase)

@pytorch-bot pytorch-bot bot removed the ciflow/trunk Trigger trunk jobs on your pull request label Dec 16, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 3 mandatory check(s) failed. The first few are:

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@mikaylagawarecki
Copy link
Contributor

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Dec 16, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

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

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged open source release notes: nn release notes category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

input_size argument of nn.RNN() gets indirect error messages

5 participants