Installing from source (I’m using what’s on master right now for pytorch) didn’t change the behaviour but there is some interesting new info in the stacktrace from the debugger:
$ gdb python
GNU gdb (GDB) 7.12.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python...done.
(gdb) run net_test.py
Starting program: /home/clemente/anaconda3/bin/python net_test.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
warning: File "/home/clemente/anaconda3/lib/libstdc++.so.6.0.19-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
        add-auto-load-safe-path /home/clemente/anaconda3/lib/libstdc++.so.6.0.19-gdb.py
line to your configuration file "/home/clemente/.gdbinit".
To completely disable this security protection add
        set auto-load safe-path /
line to your configuration file "/home/clemente/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
        info "(gdb)Auto-loading safe path"
[New Thread 0x7fffe7d8f700 (LWP 22877)]
done
^C
Thread 1 "python" received signal SIGINT, Interrupt.
0x00007ffff76c4299 in pthread_cond_destroy@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
(gdb) bt
#0  0x00007ffff76c4299 in pthread_cond_destroy@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007fffee44450e in torch::autograd::ReadyQueue::~ReadyQueue (this=0xb8ac10, __in_chrg=<optimized out>)
    at torch/csrc/autograd/engine.cpp:36
#2  std::default_delete<torch::autograd::ReadyQueue>::operator() (this=<optimized out>, __ptr=0xb8ac10)
    at /home/clemente/anaconda3/gcc/include/c++/bits/unique_ptr.h:67
#3  std::unique_ptr<torch::autograd::ReadyQueue, std::default_delete<torch::autograd::ReadyQueue> >::~unique_ptr (
    this=0xb8abf0, __in_chrg=<optimized out>) at /home/clemente/anaconda3/gcc/include/c++/bits/unique_ptr.h:184
#4  std::_Destroy<std::unique_ptr<torch::autograd::ReadyQueue> > (__pointer=0xb8abf0)
    at /home/clemente/anaconda3/gcc/include/c++/bits/stl_construct.h:93
#5  std::_Destroy_aux<false>::__destroy<std::unique_ptr<torch::autograd::ReadyQueue>*> (__last=0xb8abf8, __first=0xb8abf0)
    at /home/clemente/anaconda3/gcc/include/c++/bits/stl_construct.h:103
#6  std::_Destroy<std::unique_ptr<torch::autograd::ReadyQueue>*> (__last=0xb8abf8, __first=<optimized out>)
    at /home/clemente/anaconda3/gcc/include/c++/bits/stl_construct.h:126
#7  std::_Destroy<std::unique_ptr<torch::autograd::ReadyQueue>*, std::unique_ptr<torch::autograd::ReadyQueue> > (
    __last=0xb8abf8, __first=<optimized out>) at /home/clemente/anaconda3/gcc/include/c++/bits/stl_construct.h:151
#8  std::vector<std::unique_ptr<torch::autograd::ReadyQueue, std::default_delete<torch::autograd::ReadyQueue> >, std::allocator<std::unique_ptr<torch::autograd::ReadyQueue, std::default_delete<torch::autograd::ReadyQueue> > > >::~vector (
    this=0x7fffee783248 <engine+8>, __in_chrg=<optimized out>)
    at /home/clemente/anaconda3/gcc/include/c++/bits/stl_vector.h:415
#9  torch::autograd::Engine::~Engine (this=0x7fffee783240 <engine>, __in_chrg=<optimized out>)
    at /home/clemente/src/pytorch/torch/csrc/autograd/engine.h:21
#10 0x00007ffff6a276c0 in __run_exit_handlers () from /usr/lib/libc.so.6
#11 0x00007ffff6a2771a in exit () from /usr/lib/libc.so.6
#12 0x00007ffff7a4ba19 in Py_Exit (sts=0) at Python/pylifecycle.c:1541
#13 0x00007ffff7a4ee82 in handle_system_exit () at Python/pythonrun.c:602
#14 0x00007ffff7a4f12d in PyErr_PrintEx (set_sys_last_vars=1) at Python/pythonrun.c:612
#15 0x00007ffff7a4fa1d in PyRun_SimpleFileExFlags (fp=<optimized out>, filename=<optimized out>, closeit=<optimized out>,
    flags=0x7fffffffe320) at Python/pythonrun.c:401
#16 0x00007ffff7a6aa41 in run_file (p_cf=0x7fffffffe320, filename=0x604110 L"net_test.py", fp=0x6615d0) at Modules/main.c:320
#17 Py_Main (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:781
---Type <return> to continue, or q <return> to quit---q
Quit
(gdb) q
A debugging session is active.

        Inferior 1 [process 22871] will be killed.

Quit anyway? (y or n) y

It seems like gdb is complaining about not being able to access the version of libstdc++ installed by conda. It is possible that pytorch is also using my host version of libstdc++?