index_put_ take min when there are repeated indices #19197
Labels
enhancement
Not as big of a feature, but technically not a bug. Should be easy to fix
low priority
We're unlikely to get around to doing this in the near future
module: advanced indexing
Related to x[i] = y, index functions
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
馃殌 Feature
Assume we want to get this:
image[x,y]=p, where x, y, p are lists. For example,
x=[1, 1, 2]
y=[3, 3, 4]
p=[1, 2, 3]
It should be mentioned that image[x][y] may be updated twice, since x[0]=x[1]=1, y[0]=y[1]=3, but p[0]=1, p[1]=2. In this case, image[1][3] should be the minimum, 1.
But it seems that
torch.wheredoes not consider that one element in list can be updated twice or more.Is there an efficient way to do this? Better use OP of Pytorch. I can update image in a for loop, but it鈥檚 too slow, since the len(x) is big.
Motivation
Pitch
Alternatives
Additional context
The text was updated successfully, but these errors were encountered: