forked from spcl/pymlir
-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
import mlir
mlir_text = r"""
func @bad_func() -> tensor<8xf32> {
%0 = constant dense<0.0> : tensor<8xf32> : tensor<8xf32>
return %0 : tensor<8xf32>
}
"""
print(mlir_text)
mlir.parse_string(mlir_text)
This should not parse. It does parse.
Ideally, %0 = constant dense<0.0> : tensor<8xf32> : tensor<8xf32> would cause an exception to be raised.
Proximal cause:
- This is the rule for
dense_elements_attribute. It requires a colon+type. dense_elements_attributeis a sub-rule ofelements_attribute.elements_attributeis a sub-rule ofstandard_attribute.standard_attributeis a sub-rule ofattribute_value.attribute_valueis used in theconstantop of the standard dialect, which additionally requires a type to be written (which means 2 type declarations in total, which causes the bug).
Perhaps having this parse is a non-issue since one could argue that it might be syntactically valid (which I'm not sure I agree with) but is semantically invalid.
Metadata
Metadata
Assignees
Labels
No labels