Skip to content

[relax][tflite] Add PRELU/LRN/SQUARED_DIFFERENCE tests (partial #18971)#19404

Merged
tlopex merged 3 commits intoapache:mainfrom
0xjah:pr/tflite-relax-conv-linear-pooling-tests
Apr 15, 2026
Merged

[relax][tflite] Add PRELU/LRN/SQUARED_DIFFERENCE tests (partial #18971)#19404
tlopex merged 3 commits intoapache:mainfrom
0xjah:pr/tflite-relax-conv-linear-pooling-tests

Conversation

@0xjah
Copy link
Copy Markdown
Contributor

@0xjah 0xjah commented Apr 14, 2026

Summary

This PR partially implements test coverage requested in issue #18971 for Relax TFLite frontend operator tests.

Added explicit tests in tests/python/relax/test_frontend_tflite.py:

  • PRELU
  • SQUARED_DIFFERENCE
  • LOCAL_RESPONSE_NORMALIZATION

Validation

Ran:

  • pytest tests/python/relax/test_frontend_tflite.py -k 'test_prelu or test_squared_difference or test_local_response_normalization' -q

Result:

  • 3 passed

Refs: #18971

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements Local Response Normalization (LRN) in the TFLite frontend by decomposing it into square, average pooling, and power operations, as Relax currently lacks a native LRN operator. It also fixes the argument order in the squared difference conversion, adds normalization to PReLU broadcasting, and removes redundant parameters from transpose convolution. Extensive unit tests were added for these operators. Feedback focuses on ensuring the LRN pooling step correctly handles boundary conditions by setting count_include_pad=True and normalizing the reshaped pooled output to maintain consistent structural information.

Comment thread python/tvm/relax/frontend/tflite/tflite_frontend.py
Comment thread python/tvm/relax/frontend/tflite/tflite_frontend.py Outdated
@0xjah 0xjah force-pushed the pr/tflite-relax-conv-linear-pooling-tests branch from db0ca93 to 0fb61e5 Compare April 14, 2026 23:46
Copy link
Copy Markdown
Member

@tlopex tlopex left a comment

Choose a reason for hiding this comment

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

LGTM Thanks!

@tlopex tlopex merged commit 14751b3 into apache:main Apr 15, 2026
10 checks passed
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.

2 participants