Files
apache--tvm/python
as4230 d6ef18e771 [Relax][Frontend][TFLite] Add DILATE operator mapping (#19481)
This PR adds TFLite frontend support for the DILATE operator which
extends a tensor by inserting a padding value between existing elements
per axis according to the dilation strides.

Decomposes into existing Relax primitives instead of registering a new
op:
applied per axis:
- relax.op.reshape adds a size-1 stride-axis and merges it back after
padding
- relax.op.full builds a padding tensor with (stride - 1) values along
that axis
- relax.op.concat interleaves the padding between input elements
- relax.op.strided_slice trims the trailing pad to output size

Both static and dynamic dilations are supported.

Frontend tests use hand-rolled .tflite fixtures since DILATE has no
public TF Python emitter through tf.lite.TFLiteConverter, so the
standard verify(TestClass, Expected) pattern can't reach it. Extends
DENSIFY's fixture builders to handle BuiltinOptions2 and non-FLOAT32
tensors. _finish_tflite_model now writes the TFL3 file identifier so the
produced buffer is a valid input for tf.lite.Interpreter in the nightly
E2E path.

Validation:
python -m pytest tests/python/relax/test_frontend_tflite.py -k dilate -v

Addresses the DILATE item under #19412.
2026-05-01 12:06:42 +08:00
..