[Relax][TFLite] Add test coverage for Reduction operations (#18971)#19370
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive test suite for TFLite reduction operations in the Relax frontend, covering sum, mean, max, min, and product operations. It includes a new helper function, _make_reduce_expected, to generate the expected Relax modules and utilizes parameterized testing to verify various input shapes, reduction axes, data types, and dimension retention settings. I have no feedback to provide.
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.
Closes part of #18971
Description
This PR improves the test coverage of the TFLite frontend to Relax converter by adding comprehensive tests for the "Reductions" group.
Operations covered:
SUM(tf.reduce_sum)MEAN(tf.reduce_mean)REDUCE_MAX(tf.reduce_max)REDUCE_MIN(tf.reduce_min)REDUCE_PROD(tf.reduce_prod)Changes made:
test_reduction_ops) to cover combinations of the aforementioned reduction operators.None(global reduction).keepdimsflag (True/False) and dtypes (float32/int32).axis=None) in the expected Relax IR Module_make_reduce_expectedutility by expanding it to all input axes, perfectly mirroring the frontend's output graph structure (list(range(len(input_shape)))).Testing