-
Notifications
You must be signed in to change notification settings - Fork 341
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
Shape Inference code for the DepthToSpace operator #903
Conversation
Signed-off-by: Ettore Tiotto <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please resolve the conflict between code and comments.
Signed-off-by: Ettore Tiotto <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@etiotto my understanding is that both depthofspace and spaceofdepth requires the input to be of rank 4. That is a perfect example for introducing a verify
method.
One can be added by adding the op in utiles/gen-onnx-mlir
in the python array OpsWithVerifier
.
You can look at other verifiers in OnnxOps.cpp
, should be a trivial change.
You have to run the onnx script that rebuilds the table gens, see https://github.com/onnx/onnx-mlir/blob/master/docs/ImportONNXDefs.md
@AlexandreEichenberger I see you have approved this PR. Can I open a separate PR to add the custom |
@etiotto sure, a different PR is ok too. |
Jenkins Linux s390x Build #2172 [push] Shape Inference code for... started at 10:14 |
Jenkins Linux amd64 Build #2173 [push] Shape Inference code for... started at 09:14 |
Jenkins Linux ppc64le Build #1282 [push] Shape Inference code for... started at 10:15 |
Jenkins Linux s390x Build #2172 [push] Shape Inference code for... passed after 50 min |
Jenkins Linux amd64 Build #2173 [push] Shape Inference code for... passed after 54 min |
Jenkins Linux ppc64le Build #1282 [push] Shape Inference code for... passed after 1 hr 2 min |
The DepthToSpace operator accepts an input tensor and has a blocksize attribute. The operator reshapes the input tensor according to the blocksize attribute. Specifically, given an input tensor of dimension [N,C,H,W] (where N is the batch axis, C is the channel or depth, H is the height and W is the width) and a blocksize, the output tensor will have shape [N, C / (blocksize * blocksize), H * blocksize, W * blocksize].
This PR implements the shape inference code for the operator.
Signed-off-by: Ettore Tiotto [email protected]