Skip to content

Different behavior of sum() in-place on CPU vs GPU #1930

@melange396

Description

@melange396
x = torch.randperm(16).resize_(4,4) # create tensor
y = x.cuda() # copy to GPU
# perform same operation on both:
x.sum(dim=0,out=x)
y.sum(dim=0,out=y)
print(y) # see expected behavior
print(x) # see zeros instead

Metadata

Metadata

Assignees

No one assigned

    Labels

    high prioritymodule: cpuCPU specific problem (e.g., perf, algorithm)module: cudaRelated to torch.cuda, and CUDA support in generalmodule: numerical-stabilityProblems related to numerical stability of operationstodoNot as important as medium or high priority tasks, but we will work on these.triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions