Use non-default random generator for network initialization

I would like to use a custom RNG as opposed to torch::manual_seed(123)

In cpp:

    cpu_gen = at::detail::createCPUGenerator();
    std::lock_guard<std::mutex> lock(cpu_gen.mutex());
    cpu_gen.set_current_seed(0);

I can pass this generator to a random function:
auto random_tensor = torch::rand(100,cpu_gen);

How do I pass this generator to the construction of a module or (for example) to torch::nn::Linear
Right now the weights are initialized by the default (global) RNG.

(Python answers are also welcome)

Thanks!