Hi @yunusemre, thanks for raising this issue. I have tried the code on my local machine and I can successfully run your script.
Could you post your onnx and torch version and PyThon version as well? You can get the environment information by this script: https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
Thanks!