tlc-pack / relax

Apache License 2.0
193 stars 58 forks source link

[Op] Change shape-related op attributes to arguments #360

Closed MasterJH5574 closed 1 year ago

MasterJH5574 commented 1 year ago

This PR changes some shape-related operator attributes to operator arguments.

This is because we have the assumption that all attribute fields should be static constant at compile-time. But in fact, the fields touched in this PR can be dynamic at compile-time. Therefore, we should treat them as arguments, which is an Expr, and can be ShapeExpr or Var at compile-time.

Specifically, this fields are:

Unit tests are updated correspondingly.

tqchen commented 1 year ago

let us change the resize to be shape. For pool size and adaptive pooling. I can only think about static case in real applications. Let us keep them as attr for now and change to IntImm