Skip to content

About seed #30

@alex1243423

Description

@alex1243423

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions