-
Notifications
You must be signed in to change notification settings - Fork 662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove possible manual seeds from test files. #2436
Conversation
items_input = [[ele[i].clone() for ele in inputs] for i in range(n)] | ||
items_result = torch.stack([functional(*items_input[i]) for i in range(n)]) | ||
|
||
# Batch the input and run | ||
torch.random.manual_seed(seed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two seeds cannot be removed. This helper function is supposed to run functions on the same seed twice and compare the results.
@@ -16,12 +16,10 @@ def assert_batch_consistency(self, transform, batch, *args, atol=1e-8, rtol=1e-5 | |||
n = batch.size(0) | |||
|
|||
# Compute items separately, then batch the result | |||
torch.random.manual_seed(seed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, the helper method must run the given function twice with the same seed. So these two seedings in this method have to stay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG given tests pass.
@skim0514 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, thanks!
For test files where applicable, removed manual seeds where applicable. Refactoring #2267