Skip to content

[relax][frontend][tflite] Add tests for fully_connected/depthwise_conv2d/transpose_conv/l2_pool2d#19372

Open
0xjah wants to merge 3 commits intoapache:mainfrom
0xjah:pr/tflite-relax-conv-linear-pooling-tests
Open

[relax][frontend][tflite] Add tests for fully_connected/depthwise_conv2d/transpose_conv/l2_pool2d#19372
0xjah wants to merge 3 commits intoapache:mainfrom
0xjah:pr/tflite-relax-conv-linear-pooling-tests

Conversation

@0xjah
Copy link
Copy Markdown

@0xjah 0xjah commented Apr 8, 2026

This PR adds Relax TFLite frontend test coverage for:

  • FULLY_CONNECTED
  • DEPTHWISE_CONV_2D
  • TRANSPOSE_CONV
  • L2_POOL_2D

Part of fixing #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 adds new test cases for the TFLite frontend, covering the fully_connected, depthwise_conv2d, transpose_conv, and l2_pool2d operators. It is recommended to include structural checks with expected IR modules in these tests to verify the correct lowering of operators and enhance test robustness.

…ility

- Fix test_depthwise_conv2d: Correct kernel shape from (3,3,2,2) to (3,3,1,2)
  - For depthwise convolution with 2 input channels and grouping, kernel should have shape
    (height, width, input_channels_per_group, depth_multiplier) = (3, 3, 1, 2)
  - This matches the format required by tf.nn.depthwise_conv2d

- Fix test_l2_pool2d: Replace deprecated tf.compat.v1.nn.l2_pool with tf.nn.pool
  - tf.compat.v1.nn.l2_pool is no longer available in current TensorFlow versions
  - Use tf.nn.pool with AVG pooling type and appropriate window shape and strides
@tlopex
Copy link
Copy Markdown
Member

tlopex commented Apr 9, 2026

Please have a look at the CI and fix it as well :)

Changed kernel shape from (3,3,1,2) to (3,3,2,1) because:
- Input shape is (1,8,8,2) with 2 channels
- depthwise_conv2d filter format: [height, width, in_channels, depth_multiplier]
- With 2 input channels, third dimension must be 2 (not 1)
- Using (3,3,2,1) means 2 output channels (one multiplier per input channel)
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