tlc-pack / relax

Apache License 2.0
193 stars 58 forks source link

[REFACTOR] StructInfo M3: MatchShape=>MatchCast #323

Closed tqchen closed 1 year ago

tqchen commented 1 year ago

This PR is M3 of https://github.com/tlc-pack/relax/issues/315

This PR introduces MatchCast node and replaces all the occurance of MatchShape to MatchCast. We also updated the Visitor/Mutator so that Visitor can recurse into Expr within StructInfo field by default.

This PR is intentionally not meant as a perfect implementation. The MatchCast is implemented to be on par with what MatchShape can do and for now only restricts to Tensor shape matching and we refactored from most of the existing logic. It offers a first step for us to complete transition of StructInfo. We will bring followup improvements to support full MatchCast.

tqchen commented 1 year ago

Depends on https://github.com/tlc-pack/relax/pull/320