Hey,
I have few questions regarding recent changes took place at TOSA dialect.
There is a new type that has been declared into TOSA dialect which is called
!tosa.shape
in this commit [TOSA] Add Tosa_Shape type and ConstShapeOp by Jerry-Ge · Pull Request #122547 · llvm/llvm-project · GitHub
For example, !tosa.shape<3>
indicates a shape with rank 3, my first question is what the
motivation behind such a type, why the old RankedTensorType
is not enough to indicate such
a requirement?
Also, having the MLIR below
func.func @test_const_shape() -> !tosa.shape<6> {
%cst = tosa.const_shape {value = dense<[[3, 1, 2] , [2, 3, 1]> : tensor<2x3xindex>} : () -> !tosa.shape<6>
return %cst : !tosa.shape<6>
}
We are trying to create a shape of rank 6 from six values of type tensor<2x3xindex>
of rank 2:
- Isn’t it the same operation of the
shape.const_shape
, why not using it instead of declaring additional operation? - Is there any meaning of not having a
flat
/one-dimensional
values in theconst_shape
? - It feels a little bit overloading for the term of
rank
, we verify that the number of the elements in theDenseElementsAttribute
equals theTosaShape
’s rank. why not calling it num of elements instead of rank?