Disallow zero dimensions in vectors and memrefs
Aggregate types where at least one dimension is zero do not fully make sense as they cannot contain any values (their total size is zero). However, TensorFlow and XLA support tensors with zero sizes, so we must support those too. This is relatively safe since, unlike vectors and memrefs, we don't have first-class element accessors for MLIR tensors. To support sparse element attributes of vector types that have no non-zero elements, make sure that index and value element attributes have tensor type so that we never need to create a zero vector type internally. Note that this is already consistent with the inline documentation of the sparse elements attribute. Users of the sparse elements attribute should not rely on the storage schema anyway. PiperOrigin-RevId: 232896707
Loading
Please sign in to comment