[all-commits] [llvm/llvm-project] 99dee3: Make it possible to create DenseElementsAttrs with...

Adam Paszke via All-commits all-commits at lists.llvm.org
Wed Mar 8 11:12:03 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 99dee31ef48012f8984ddab806b7345c24b02a72
      https://github.com/llvm/llvm-project/commit/99dee31ef48012f8984ddab806b7345c24b02a72
  Author: Adam Paszke <apaszke at google.com>
  Date:   2023-03-08 (Wed, 08 Mar 2023)

  Changed paths:
    M mlir/lib/Bindings/Python/IRAttributes.cpp
    M mlir/test/python/dialects/builtin.py

  Log Message:
  -----------
  Make it possible to create DenseElementsAttrs with arbitrary shaped types in Python bindings

Right now the bindings assume that all DenseElementsAttrs correspond to tensor values,
making it impossible to create vector-typed constants. I didn't want to change the API
significantly, so I opted for reusing the current signature of `.get`. Its `type` argument
now accepts both element types (in which case `shape` and `signless` can be specified too),
or a shaped type, which specifies the full type of the created attr (`shape` cannot be specified
in that case).

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D145053




More information about the All-commits mailing list