Which libtorch version are you using? In case an older one, could you try the latest release and see, if you are still getting this seg fault?
If so, could you get the backtrace via:
gdb --args ./my_app
...
run
...
bt

and post it here, please?