Skip to content

index_put : INTERNAL ASSERT FAILED #72053

@kshitij12345

Description

@kshitij12345

🐛 Describe the bug

Previous related issues: #39227 #66495

import torch

# device = 'cpu'  # Works

# RuntimeError: linearIndex.numel()*sliceSize*nElemBefore == expandedValue.numel()
# INTERNAL ASSERT FAILED at
# "../aten/src/ATen/native/cuda/Indexing.cu":265, please report a bug to PyTorch.
# number of flattened indices did not match number of elements in the value tensor: 10 vs 5
device = 'cuda'  # Errors
t = torch.zeros(5, 5, device=device)
idx = torch.tensor([0, 1], device=device)
v = torch.ones((5,), device=device)

print(torch.index_put(t, (idx, ), v, accumulate=True))

Versions

master

cc @ezyang @gchanan @zou3519 @ngimel

Metadata

Metadata

Assignees

Labels

high prioritymodule: cudaRelated to torch.cuda, and CUDA support in generaltriagedThis 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