Skip to content
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

About seed #30

Open
alex1243423 opened this issue Nov 30, 2024 · 0 comments
Open

About seed #30

alex1243423 opened this issue Nov 30, 2024 · 0 comments

Comments

@alex1243423
Copy link

alex1243423 commented Nov 30, 2024

Hello,

I have observed that the randomness in your code is being modified. Specifically, the rand_like function seems to be altering the random state. Please see the code below for reference.

import torch
from transformers import set_seed
set_seed(42)
random_tensor = torch.randn_like(torch.zeros(5))
another_random_tensor = torch.randn_like(torch.zeros(5))
print(random_tensor)
print(another_random_tensor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant