[RELAY][OP] Support MXNet-style attributes for reshape_like#6851
[RELAY][OP] Support MXNet-style attributes for reshape_like#6851junrushao merged 5 commits intoapache:mainfrom
Conversation
giuseros
left a comment
There was a problem hiding this comment.
Looks good overall,, only minor changes
|
|
||
| Expr MakeReshape(Expr data, Array<Integer> newshape); | ||
|
|
||
| Expr MakeReshapeLike(Expr lhs, Expr rhs, int64_t lhs_begin, Integer lhs_end, int64_t rhs_begin, |
There was a problem hiding this comment.
Why {lhs,rhs}_begin is int64_t and {lhs,rhs}_end is Integer?
There was a problem hiding this comment.
I did this because the beginning index (in both cases) must always be an integer, but the end index can be None which means I must use a nullable Integer wrapper. I could make everything Integer and check that beginning is always defined. I did feel a bit weird using int64_t directly since everything else seem to use int but the value wrapped by Integer is int64_t so that's why I chose it.
There was a problem hiding this comment.
I noticed that the Attrs I defined uses int and not int64_t so I'll probably just use int since other code mostly uses it.
electriclilies
left a comment
There was a problem hiding this comment.
Overall looks good, just one style comment
giuseros
left a comment
There was a problem hiding this comment.
Thanks for addressing the comments! LGTM
|
Thanks @altanh @tkonolige @electriclilies @jroesch @giuseros! It is now merged :-) |
This PR adds MXNet-style shape slicing attributes for
reshape_like, to enable reshaping part of a shape (using part of another shape). In particular, this addslhs_begin, lhs_end, rhs_begin, rhs_end.cc @kevinthesun @icemelon9 @junrushao1994