linalg.pad_tensor is an operation that pads the source tensor
with given low and high padding config.
Example 1:
mlir %pad_value = ... : f32 %1 = linalg.pad_tensor %0 low[1, 2] high[2, 3] { ^bb0(%arg0 : index, %arg1 : index): linalg.yield %pad_value : f32 } : tensor<?x?xf32> to tensor<?x?xf32>
Example 2:
mlir %pad_value = ... : f32 %1 = linalg.pad_tensor %arg0 low[2, %arg1, 3, 3] high[3, 3, %arg1, 2] { ^bb0(%arg2: index, %arg3: index, %arg4: index, %arg5: index): linalg.yield %pad_value : f32 } : tensor<1x2x2x?xf32> to tensor<6x?x?x?xf32>
I think you can't just use SameVariadicOperandSize, the following shouldn't work:
.pad_tensor %t low[0, 0] high[%ub0, %ub1].
Indeed you're missing a test for this.
You need to handle your operand_segment_size manually.
See https://github.com/llvm/llvm-project/blob/b1e1bbae0e30c89251940efb0780eee6a1b79ecd/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td#L226
and https://github.com/llvm/llvm-project/blob/118a71565462db41cab1dbb0349200627d6e8524/mlir/lib/Interfaces/ViewLikeInterface.cpp#L161 if you need an example.