Hi all!
I have some MLIR (16.0.6 version) bindings for OCaml. It’s closely matching the MLIR C API. Now I’m trying to implement a toy tutorial via OCaml. I am faced with the problem of shape inference for tensors.
In toy tutorial, shape inference implemented like that:
void TransposeOp::inferShapes() {
auto arrayTy = getOperand().getType().cast<RankedTensorType>();
SmallVector<int64_t, 2> dims(llvm::reverse(arrayTy.getShape()));
getResult().setType(RankedTensorType::get(dims, arrayTy.getElementType()));
}
But I didn’t find analogue in C API for setType
function for MlirValue
.
How can I implement this?