Hi,
I would like to create a RNG generator which can be seeded individually (as opposed to the global torch::manual_seed(123)
.
However, I keep running into segmentation faults. I understood the at::Generator is not thread-safe, and therefore a mutex is necessary, but even just creating the mutex gives me a segfault:
auto gen_cpu = torch::Generator();
std::lock_guard<std::mutex> lock(gen_cpu.mutex());
//Results in segfault
auto gen_cpu = torch::Generator();
gen_cpu.set_current_seed(0);
//Also results in segfault
Any help with how the Generator should be created and seeded without segfaults?
Thanks!