onnx2pytorch icon indicating copy to clipboard operation
onnx2pytorch copied to clipboard

DepthToSpace

Open abigos opened this issue 4 years ago • 5 comments

Currently DepthToSpace throws a NotImplemented error, any plan to support this?

Thanks

abigos avatar Oct 18 '21 15:10 abigos

Do you have a link to a public ONNX model that uses this op?

The main application for this is super-resolution, however a quick google didn't throw up anything using it. Nice description of the operation here . I'm not able to share our model at the moment, sorry.

abigos avatar Oct 18 '21 19:10 abigos

Thanks! I'm hoping to circle back with some other updates to onnx2pytorch around December-January, and will try to address this if it's not already implemented by then. But for what it's worth, as a non-maintainer/user who recently started contributing, it's quite easy to add this as a supported op. You'd just need to translate that numpy code into pytorch and place it as a new nn.Module in onnx2pytorch/operations/depthtospace.py.

You can add the new operation as described by Calvin. You should also add the tests to make sure the operation is doing what it should. You can copy the tests/examples from here. It looks like pytorch has this operation already implemented under pixel shuffle.

Talmaj avatar Oct 25 '21 14:10 Talmaj

what should i do if i want to support some layer in this repo and recompile a whl.

mmdzzh avatar Mar 14 '24 08:03 mmdzzh