Thanks for your comment. I did use an older pytorch, version 1.9.0a0+df837d0 from the NVIDIA container image for PyTorch release 21.03.
I just pulled the last nvidia docker container (PyTorch Release 21.11)  with pytorch version 1.11.0a0+b6df043. The problem is now solved, the previous code snippet is working.
It’s not 1st time I’ve got those kind of issues due to out-dated container or due to container with not stable version of pytorch (which seem to be usual with nvidia pytorch containers, i don’t know why). Maybe I should switch to the pytorch images from Docker Hub.
Thanks for your help,
Thomas