Closed ashay closed 11 months ago
To test the shape functions for GridSample and DepthToSpace nodes, use the following scripts to generate the ONNX files:
import onnx
from onnxscript import opset19, script, FLOAT
@script()
def this_script(X: FLOAT[1, 1, 4, 4], G: FLOAT[1, 6, 6, 2]) -> FLOAT[1, 1, 6, 6]:
return opset19.GridSample(X, G)
onnx_model = this_script.to_model_proto()
onnx.save(onnx_model, "/tmp/a.onnx")
import onnx
from onnxscript import opset19, script, FLOAT
@script()
def this_script(X: FLOAT[1, 8, 2, 3]) -> FLOAT[1, 2, 4, 6]:
return opset19.DepthToSpace(X, blocksize=2)
onnx_model = this_script.to_model_proto()
onnx.save(onnx_model, "/tmp/b.onnx")
And then reproduce the error using the following commands:
$ python3 -m onnx_tool --in /tmp/a.onnx --out /dev/null
$ python3 -m onnx_tool --in /tmp/b.onnx --out /dev/null
Thanks for your contribution! For personal reseason , your code review will be delayed for 3 days. Thanks again!
Best Regards
From: Ashay Rane @.> Sent: Wednesday, October 4, 2023 5:59:36 AM To: ThanatosShinji/onnx-tool @.> Cc: Subscribed @.***> Subject: Re: [ThanatosShinji/onnx-tool] Add shape functions and ignore un-consumed outputs (PR #53)
To test the shape functions for GridSample and DepthToSpace nodes, use the following scripts to generate the ONNX files:
import onnx
from onnxscript import opset19, script, FLOAT
@script() def this_script(X: FLOAT[1, 1, 4, 4], G: FLOAT[1, 6, 6, 2]) -> FLOAT[1, 1, 6, 6]: return opset19.GridSample(X, G)
onnx_model = this_script.to_model_proto() onnx.save(onnx_model, "/tmp/a.onnx")
import onnx
from onnxscript import opset19, script, FLOAT
@script() def this_script(X: FLOAT[1, 8, 2, 3]) -> FLOAT[1, 2, 4, 6]: return opset19.DepthToSpace(X, blocksize=2)
onnx_model = this_script.to_model_proto() onnx.save(onnx_model, "/tmp/b.onnx")
And then reproduce the error using the following commands:
$ python3 -m onnx_tool --in /tmp/a.onnx --out /dev/null $ python3 -m onnx_tool --in /tmp/b.onnx --out /dev/null
— Reply to this email directly, view it on GitHubhttps://github.com/ThanatosShinji/onnx-tool/pull/53#issuecomment-1745792396, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZZIQRUK25WV5BS7IAVL5RLX5SDERAVCNFSM6AAAAAA5RUP27OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBVG44TEMZZGY. You are receiving this because you are subscribed to this thread.Message ID: @.***>
No worries, thanks for agreeing to review the PR!
Good work!
This PR contains two commits:
and