-
When i execute “mlir-hlo-opt cur-mhlo.mlir -hlo-legalize-to-lhlo -o cur-lhlo.mlir” to convert this file:
module attributes {tf.versions = {bad_consumers = , min_consumer = 0 : i32, producer = 561 : i32}} {
func @main(%arg0: tensor<1x224x224x3xf32>) → tensor<1x230x230x3xf32> attributes {tf.entry_function = {control_outputs = “”, inputs = “Input”, outputs = “resnet50/conv1_pad/Pad”}} {
%0 = mhlo.constant dense<0.000000e+00> : tensor
%1 = “mhlo.pad”(%arg0, %0) {edge_padding_high = dense<[0, 3, 3, 0]> : tensor<4xi64>, edge_padding_low = dense<[0, 3, 3, 0]> : tensor<4xi64>, interior_padding = dense<0> : tensor<4xi64>} : (tensor<1x224x224x3xf32>, tensor) → tensor<1x230x230x3xf32>
return %1 : tensor<1x230x230x3xf32>
}
} -
MLIR reported this error:
cur-mhlo.mlir:4:10: error: failed to legalize operation ‘mhlo.pad’ that was explicitly marked illegal
I didn’t find conversion logic for “mhlo.pad” operation in hlo_legalize_to_lhlo.cc createLegalizeToLhloPass()
. How to convert “mhlo.pad” to Lhlo dialect? Or maybe it is not supported, i should directly use “LegalizeHloToLinalgPass”?