This operation is used to materialize a tensor of a particular
shape. The shape could be specified as a mix of static and dynamic
values.
The use of this operation is to be an init tensor for Linalg
structured operation on tensors where the bounds of the computation
depends on the shape of the output of the linalg operation. The result
of this operation will be used as the init tensor of such Linalg
operations. To note,
- The values in the tensor materialized is not used. Any operation to which this is an init tensor is expected to overwrite the entire tensor.
- The tensor is materialized only for the shape of the output and to make the loop bounds depend only on operands of the structured operation.
Based on (1) and (2) it is assumed that these operations eventually go
away since they are only used in dim operations that can be
canonicalized to make this operation dead. Such canonicalization are
added here too.
Depends On D93180
you can take the static sizes from the result type. (you probably just want to imitate how std.alloc, std.dynamic_tensor_from_elements, etc. model this; they have Variadic<Index> with one entry for each ? in the result type)