Skip to content

error message for Tensor.index_put_ could be improved for MPS failure mode #160034

@alisterburt

Description

@alisterburt
import torch

device = torch.device("mps")  # Requires Apple Silicon Mac
image = torch.zeros(10, dtype=torch.complex64, device=device)
data = torch.ones(3, dtype=torch.complex64, device=device)
indices = torch.tensor([1, 3, 5], device=device)

# This fails on MPS with complex64
image.index_put_(indices=(indices,), values=data, accumulate=True)
RuntimeError: Expected supportedFloatingType(scalar_type) || scalar_type == kInt || scalar_type == kBool to be true, but got false.  (Could this error message be improved?  If so, please report an enhancement request to PyTorch.)

Ideally this error would explicitly say that index_put_ does not support complex value insertion with the MPS backend

cc @ezyang @anjali411 @dylanbespalko @mruberry @nikitaved @amjames @kulinseth @albanD @malfet @DenisVieriu97 @jhavukainen

Metadata

Metadata

Assignees

Labels

actionablemodule: complexRelated to complex number support in PyTorchmodule: mpsRelated to Apple Metal Performance Shaders frameworktriagedThis 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