Skip to content

Invalid dense constant assignment being parsed. #7

@paul-tqh-nguyen

Description

@paul-tqh-nguyen
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:

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions