Skip to content

[MLIR] fix _f64ElementsAttr in ir.py #91176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 6, 2024
Merged

Conversation

qingyunqu
Copy link
Contributor

it seems a typo.

@llvmbot
Copy link
Member

llvmbot commented May 6, 2024

@llvm/pr-subscribers-mlir

Author: Yuanqiang Liu (qingyunqu)

Changes

it seems a typo.


Full diff: https://github.com/llvm/llvm-project/pull/91176.diff

1 Files Affected:

  • (modified) mlir/python/mlir/ir.py (+1-1)
diff --git a/mlir/python/mlir/ir.py b/mlir/python/mlir/ir.py
index eb7f035fec7c1f..80c965b2d0eb2c 100644
--- a/mlir/python/mlir/ir.py
+++ b/mlir/python/mlir/ir.py
@@ -274,7 +274,7 @@ def _memref_type_attr(x, context):
     @register_attribute_builder("F64ElementsAttr")
     def _f64ElementsAttr(x, context):
         return DenseElementsAttr.get(
-            np.array(x, dtype=np.int64),
+            np.array(x, dtype=np.float64),
             type=F64Type.get(context=context),
             context=context,
         )

@joker-eph
Copy link
Collaborator

Can you add a test for this?

@joker-eph joker-eph merged commit 10ec0d2 into llvm:main May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlir:python MLIR Python bindings mlir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants