Skip to content

Inconsistency between bernoulli and bernoulli_ #1259

@hengyuan-hu

Description

@hengyuan-hu
import torch                                                                               
                                                                                           
a = torch.FloatTensor(3, 5).uniform_(0, 1)                                                 
a.round_()                                                                                 
                                                                                           
print a.bernoulli()                                                                        
print a.bernoulli_()                                                                       

Tensor a is rounded to 0 or 1 so the bernoulli sampling should be deterministic. However, two printed bernoulli are different.

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: docsRelated to our documentation, both in docs/ and docblockstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions