Are there any examples for linalg dialect operation?

Hello everyone,

I’ve been trying to run linalg dialect these days.
For example, the document shows that mlir::linalg::Conv2DNchwFchwOp operands are inputs and outputs. I think the inputs should contain input and kernel, but I don’t know how to construct a inputs.
Are there any examples for linalg dialect operation?

Thanks in advance!

Wow, sorry for my careless :frowning_face_with_open_mouth: .
I find some linalg dialect examples in test directory.

Unfortunately there doesn’t seem to be much. You can find the interface in $BUILD_DIR/tools/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.h.inc and you can get a general idea of the expected structure in the CHECK statements here: mlir-hlo/hlo-legalize-to-linalg.mlir at master · tensorflow/mlir-hlo · GitHub

In your case, inputs is referring to the ValueRange of 2 tensors it looks like.

Thanks for @tpopp advice!
I will study the code carefully.