[Relax][Frontend][TFLite] Add SCATTER_ND operator for Relax TFLite#19490
Merged
tlopex merged 2 commits intoapache:mainfrom May 1, 2026
Merged
[Relax][Frontend][TFLite] Add SCATTER_ND operator for Relax TFLite#19490tlopex merged 2 commits intoapache:mainfrom
tlopex merged 2 commits intoapache:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds support for the SCATTER_ND operator to the TFLite frontend in Relax and includes a new test case to verify its functionality. The review feedback highlights two necessary corrections: the indices tensor needs to be permuted to align with Relax's expected layout (where the index depth is the first dimension), and the shape tensor must be explicitly cast to int64 when handled dynamically to satisfy the requirements of the tensor_to_shape operator.
tlopex
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for the
SCATTER_NDoperator in the Relax TFLite frontend.Key Changes:
convert_scatter_ndto parseindicesandupdates.to_int_listandrelax.op.tensor_to_shape.relax.op.zerosto initialize the base array based on theupdatesprecision dtype.SCATTER_NDto the correspondingrelax.op.scatter_nd()target.convert_mapand provided the matching unit test in test_frontend_tflite.py.Testing:
Passed unit tests
Related to #19412