[mlir][Parser] Update DenseElementsAttr to print in hex when the number of elements...
authorRiver Riddle <riddleriver@gmail.com>
Thu, 20 Feb 2020 22:37:25 +0000 (14:37 -0800)
committerRiver Riddle <riddleriver@gmail.com>
Thu, 20 Feb 2020 22:40:58 +0000 (14:40 -0800)
commit51bf5d3cc19ac113de2ff185fb5bc2b99b8d89bc
treefaa9b9f1470f800d98925a8ab29c4830ae676589
parent577d9ce35532439203411c999deefc9c80e04c69
[mlir][Parser] Update DenseElementsAttr to print in hex when the number of elements is over a certain threshold.

Summary: DenseElementsAttr is used to store tensor data, which in some cases can become extremely large(100s of mb). In these cases it is much more efficient to format the data as a string of hex values instead.

Differential Revision: https://reviews.llvm.org/D74922
mlir/include/mlir/IR/Attributes.h
mlir/lib/IR/AsmPrinter.cpp
mlir/lib/IR/Attributes.cpp
mlir/lib/Parser/Parser.cpp
mlir/test/IR/dense-elements-hex.mlir [new file with mode: 0644]
mlir/test/IR/invalid.mlir