[mlir][sparse][taco] Support reduction to scalar tensors.
authorBixia Zheng <bixia@google.com>
Fri, 25 Feb 2022 17:28:39 +0000 (09:28 -0800)
committerBixia Zheng <bixia@google.com>
Fri, 25 Feb 2022 22:17:45 +0000 (14:17 -0800)
commit6f071911010323f23f45eadff0d037b1d04a8e7d
tree82af93234c898cee6e959728f3a4aaa7aa3703e7
parent63bf228450b8403e0c5e828d276be47ffbcd00d0
[mlir][sparse][taco] Support reduction to scalar tensors.

The PyTACO DSL doesn't support reduction to scalars. This change
enhances the MLIR-PyTACO implementation to support reduction to scalars.

Extend an existing test to show the syntax of reduction to scalars and
two methods to retrieve the scalar values.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D120572
mlir/test/Integration/Dialect/SparseTensor/taco/test_scalar_tensor_algebra.py
mlir/test/Integration/Dialect/SparseTensor/taco/tools/mlir_pytaco.py