Adding new op to HLO and lower tf op to new HLO op

I have created new op in HLO that is in hlo_ops.td. and I want to add these op in tf to HLO lowering .For these I added lowering in legalize_tf.cc but when I nuild tensorflow getting error as

In file included from external/org_tensorflow/tensorflow/compiler/mlir/xla/mlir_hlo_to_hlo.cc:1274:
bazel-out/k8-opt/bin/external/org_tensorflow/tensorflow/compiler/mlir/xla/operator_writers.inc:483:26: error: no member named ‘Newop’ in namespace ‘xla’

What are the files I need to change inorder to create new op HLO and add it to tf to HLO lowering?

Thanks

I believe this is the same issue you filed in IREE Adding new op to HLO and add tf to HLO lowering and add it to the iree-import-tf · Issue #7586 · google/iree · GitHub. Did my advice in Adding new op to HLO and add tf to HLO lowering and add it to the iree-import-tf · Issue #7586 · google/iree · GitHub not work?

If you don’t care about XLA HLO output, you can also set let hasCustomHLOConverter = 1; as Geoffrey mentioned, else you’ll need to add something to tensorflow/compiler/mlir/xla/mlir_hlo_to_hlo.cc (adding an HLO through XLA is a bit of work & would require discussions there).

I able to do the conversion I added
LogicalResult ExportXlaOp(LeakyReluOp op, OpLoweringContext ctx) {
return failure();
}

in tensorflow/compiler/mlir/xla/mlir_hlo_to_hlo.cc

Thank you