-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[Relay][Legalize][ARM_CPU] Handling NHWC layout for arm_cpu. #3754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,6 +71,28 @@ def conv2d(input, filter, strides, padding, dilation, layout='NCHW', out_dtype=N | |
| raise ValueError("not support this layout {} yet".format(layout)) | ||
|
|
||
|
|
||
| @tvm.target.generic_func | ||
| def conv2d_legalize(attrs, inputs, arg_dtypes, F): | ||
| """Legalizes Conv2D op. | ||
| Parameters | ||
| ---------- | ||
| attrs : nnvm.top.AttrDict or tvm.attrs.Attrs | ||
| Attributes of current convolution | ||
| inputs : list of tvm.relay.Expr | ||
| The args of the Relay expr to be legalized. | ||
| arg_dtypes : list of types | ||
| List of types of input arguments | ||
| F: symbol | ||
| The context, can be either nnvm.sym or relay.op | ||
| Note | ||
| ---- | ||
| Unlike other TOPI functions, this function operates on both graph level and operator level, | ||
| so we have to pass 'F' to make it support our two versions of graph IR, NNVM and Relay. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @anijain2305 why are NNVM and
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, thanks for pointing out. I copied the description from other functions which have this comment. Will send a separate PR to clean up the comments. |
||
| """ | ||
| # not to change by default | ||
| return None | ||
|
|
||
|
|
||
| @tvm.target.generic_func | ||
| def conv2d_alter_layout(attrs, inputs, tinfos, F): | ||
| """Change Conv2D layout. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.