Question: Typo in the documentation for tensor.dim?

I am unable to reproduce the second code example shown for the tensor.dim op:

// Return the dynamic dimension of %A.
%c1 = arith.constant 1 : index
%y = tensor.dim %A, %c1 : memref<4x?xf32>

Running mlir-opt with a memref as the base argument and return type outputs:

tensor_dim_2.mlir:13:37: error: custom op 'tensor.dim' invalid kind of type specified
        %out = tensor.dim %mr, %i : memref<4x?xf32>

Was this a typo or copy/paste error from memref.dim in the documentation?

Best,
Gio

Was this a typo or copy/paste error from memref.dim in the documentation?

Very likely, feel free to send a patch to fix it.

1 Like

Thanks @mehdi_amini. Please see PR #119095.