torch.scatter_: support index.size(d) > src.size(d) #63265
Comments
I'd like to work on this issue. |
Can I solve this issue? |
Would like to work on this |
You are looking to index on different dimensions at the same time. I had a look around in the documentation, torch.index_add will only receive a vector as index. My hopes were on torch.scatter but it doesn't to fit well to this problem. As it turns out you can achieve this pretty easily with a little work, the most difficult parts are the setup and teardown. |
Awesome, thanks!
…On Thu, 19 Aug 2021, 8:27 am MohitAnand-Hub, ***@***.***> wrote:
You are looking to index on different dimensions at the same time. I had a
look around in the documentation, torch.index_add will only receive a
vector as index. My hopes were on torch.scatter but it doesn't to fit well
to this problem. As it turns out you can achieve this pretty easily with a
little work, the most difficult parts are the setup and teardown.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#63265 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARSLAGVL5SWDM3Z3UJ7L7TDT5RXLLANCNFSM5CEQD4XA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
Hello, I am a beginner and I would like to contribute to this project. Can you please help me with how to get started ? |
Hello, I am a beginner and I want to contribute to this project. Can you please help me to get started? |
Hello , I wanna do my first pull request can you help me with that by allowing me to contribute? |
Yes, I can help you.
…On Thu, 19 Aug 2021, 3:53 pm ankit332000, ***@***.***> wrote:
Hello , I wanna do my first pull request can you help me with that by
allowing me to contribute?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#63265 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARSLAGWYZG5SVDCLMCZACQTT5TLSHANCNFSM5CEQD4XA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
Teach torch.Tensor.scatter_ to handle
index.size(d) > src.size(d)
.Motivation
Currently,
torch.Tensor.scatter_
requiresindex.size(d) <= src.size(d)
for all dimensionsd
, unlesssrc
is float-valued. This constraint seems artificial.Alternatives
An inefficient workaround is to chunk the index tensor:
The text was updated successfully, but these errors were encountered: