Skip to content

[TOPI][RELAY][ONNX] Scatter ND#7927

Merged
jcf94 merged 6 commits intoapache:mainfrom
mbrookhart:onnx_scatter_nd
Apr 28, 2021
Merged

[TOPI][RELAY][ONNX] Scatter ND#7927
jcf94 merged 6 commits intoapache:mainfrom
mbrookhart:onnx_scatter_nd

Conversation

@mbrookhart
Copy link
Copy Markdown
Contributor

This PR refactors the relay scatter_nd op in two ways:

  1. scatter_nd now takes in a data tensor, and updates are scattered based on indices. The previous API assumed zero-initialization for the data.
  2. scatter_nd now has a "mode" argument to determine how to update the input data, either "add" or "update". This is to support the use cases as a gradient of gather_nd and to support the ONNX and pytorch APIs. TF also supports "max", "min", and "sub", which are not yet supported here.

This also adds ScatterND to the ONNX importer.

cc @tkonolige @altanh @jwfromm @masahi

Comment thread python/tvm/topi/cuda/scatter.py Outdated
Comment thread python/tvm/topi/x86/scatter.py Outdated
Comment thread python/tvm/topi/cuda/scatter.py Outdated
Comment thread python/tvm/topi/scatter.py Outdated
Copy link
Copy Markdown
Contributor

@jwfromm jwfromm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, LGTM.

Copy link
Copy Markdown
Contributor

@altanh altanh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👌

@jcf94 jcf94 merged commit 8fce895 into apache:main Apr 28, 2021
@jcf94
Copy link
Copy Markdown
Contributor

jcf94 commented Apr 28, 2021

Thanks! @mbrookhart @tkonolige @jwfromm @altanh

@mbrookhart mbrookhart deleted the onnx_scatter_nd branch April 28, 2021 16:13
echuraev pushed a commit to echuraev/tvm that referenced this pull request Apr 29, 2021
* passing topi tests

* passing relay tests, needs better shape checking still

* support ONNX operator

* add shape checking back in

* fix lint

* update docstring
umangyadav pushed a commit to umangyadav/tvm that referenced this pull request May 5, 2021
* passing topi tests

* passing relay tests, needs better shape checking still

* support ONNX operator

* add shape checking back in

* fix lint

* update docstring
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
* passing topi tests

* passing relay tests, needs better shape checking still

* support ONNX operator

* add shape checking back in

* fix lint

* update docstring
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
* passing topi tests

* passing relay tests, needs better shape checking still

* support ONNX operator

* add shape checking back in

* fix lint

* update docstring
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
* passing topi tests

* passing relay tests, needs better shape checking still

* support ONNX operator

* add shape checking back in

* fix lint

* update docstring
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request May 11, 2021
* passing topi tests

* passing relay tests, needs better shape checking still

* support ONNX operator

* add shape checking back in

* fix lint

* update docstring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants