Commit Graph

4 Commits

Author SHA1 Message Date
Tung D. Le 034f98c00c
Shape inference for some ops in RNN models (#207)
* Shape inference for ShapeOp

* Shape inference for TileOp

* Fix check-doc

* Fix onnx-mlir-doc

* Shape inference for GatherOp

* Check validity of GatherOp's indices tensor

* Shape inference for Slice

* Tests for SliceOp

* Fix importing none inputs

* Type inference for constantofshape

* Empty tensor in case of ConstantOfShape

* Remove unrelated changes

Co-authored-by: chentong319 <chentong@us.ibm.com>
2020-07-22 10:15:56 -04:00
chentong319 2e08b2112c
String type (Ready for Review) (#182)
* string type from tensorflow

* simplify type

* parser and print

* gen StringType for tablegen

* onnx to onnx-mlir type

* add namespace

* allow all integer type

* dialect document

* add test case

* format

* more precise type for ONNXOp

* format

* enable the failed test

* update comment

* update onnx.md

Co-authored-by: Gheorghe-Teodor Bercea <gt.bercea@gmail.com>
2020-06-25 16:34:37 -04:00
chentong319 23bea50404
Implement PadOp based on attribute promotion (#71)
* enable promote attr for pad

* use optional arguments for pad

* shape infereance for pad

* Lowering Pad

* format file

* use DenseTensor for the attribute

* use Pad in ONNXRewrite

* fix the merge conflict

* fix the attr given to constantOp

* handle ONNXConstantOp in attribute promotion

* Fix bug when AttributePromotion is called more than once

* update ONNXOps.td.inc with correct version of onnx

* update onnx.md

* responses to review

* fix the build error

* change the implementation of Pad

* delete commented out code

* clang format

Co-authored-by: Tian Jin <tjingrant@gmail.com>
2020-05-15 13:19:28 +08:00
Tian Jin 549af8f0b2
Support attribute promotion. (#34)
* Support attribute promotion.

* Simplify op interface name.

* 1. Add more comments to Attribute Promotion Pass.
2. Move Promotable Const Operand Interface to src/interface, and link against it.

* Complete NFC change onnx -> onnx-mlir.

* Move attribute_promotion pass to src/transform.

* Nit: reword comment.

* Support Attribute Promotion in gen_doc.py.

* Add test.

* Update ONNX doc.

* Add negative test.

* Rename onnxop.inc -> onnx_ops.td.inc.

* Include onnx_ops.td.inc.

* Nit: better comments.

* Prettify CMake.

* Remove original attribute_promotion code, improve comments.

* Append '_op_interface' to op interface decl/defs.

* Namespace cmake targets using onnx_mlir_ prefix.

* Use updated header name.

* Use new body file name.

* Fix dependency.

* Use new CMake target name.

* Make attribute promotion self-contained by removing redundant constant operaions inside the pass execution.

* Remove canonicalization pass.

* Increase comments.

* Use stricter checks.

* Add one more test case.

* Remove %arg1 as it's never used.
2020-03-19 15:03:37 +08:00