Yes, the stacktrace seems to point to MKL/ideep:
(gdb) bt
#0  __cxxabiv1::__cxa_throw (obj=0x555558e7ed40, tinfo=0x7fffe3ae6278 <typeinfo for std::bad_alloc>, dest=0x7fffe39f910e <std::bad_alloc::~bad_alloc()>) at ../../../../libstdc++-v3/libsupc++/eh_throw.cc:77
#1  0x00007fffe39f6f8c in std::__throw_bad_alloc () at /home/conda/feedstock_root/build_artifacts/gcc_compilers_1634095553113/work/build/x86_64-conda-linux-gnu/libstdc++-v3/include/bits/exception.h:63
#2  0x00007fffe4cd1fa4 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<int const, dnnl::memory>, false> > >::_M_allocate_buckets(unsigned long) [clone .isra.585] ()
   from /home/ubuntu/miniconda3/envs/reti/lib/python3.9/site-packages/torch/lib/libtorch_cpu.so
#3  0x00007fffe4cde4f5 in std::_Hashtable<int, std::pair<int const, dnnl::memory>, std::allocator<std::pair<int const, dnnl::memory> >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_Hashtable<std::pair<int const, dnnl::memory> const*>(std::pair<int const, dnnl::memory> const*, std::pair<int const, dnnl::memory> const*, unsigned long, std::hash<int> const&, std::__detail::_Mod_range_hashing const&, std::__detail::_Default_ranged_hash const&, std::equal_to<int> const&, std::__detail::_Select1st const&, std::allocator<std::pair<int const, dnnl::memory> > const&) ()
   from /home/ubuntu/miniconda3/envs/reti/lib/python3.9/site-packages/torch/lib/libtorch_cpu.so
#4  0x00007fffe5207db0 in ideep::tensor::reorder_if_differ_in(ideep::tensor::desc const&, ideep::attr_t const&) const () from /home/ubuntu/miniconda3/envs/reti/lib/python3.9/site-packages/torch/lib/libtorch_cpu.so
#5  0x00007fffe5208243 in void ideep::convolution_forward::do_compute<true>(ideep::convolution_forward_params const&, ideep::tensor const&, ideep::tensor const&, ideep::tensor const&, ideep::tensor&) ()
   from /home/ubuntu/miniconda3/envs/reti/lib/python3.9/site-packages/torch/lib/libtorch_cpu.so
#6  0x00007fffe5203ab6 in at::native::_mkldnn_convolution(ideep::tensor const&, ideep::tensor const&, c10::optional<ideep::tensor> const&, c10::ArrayRef<long>, c10::ArrayRef<long>, c10::ArrayRef<long>, long) ()
   from /home/ubuntu/miniconda3/envs/reti/lib/python3.9/site-packages/torch/lib/libtorch_cpu.so
#7  0x00007fffe5204557 in at::native::mkldnn_convolution(at::Tensor const&, at::Tensor const&, c10::optional<at::Tensor> const&, c10::ArrayRef<long>, c10::ArrayRef<long>, c10::ArrayRef<long>, long) ()
   from /home/ubuntu/miniconda3/envs/reti/lib/python3.9/site-packages/torch/lib/libtorch_cpu.so

Are you using this lifelines repository 1 for your code?