This is actually not going to work, you have to in-place copy to result, not reassign reference.   Also, @pbelevich, in the line above we don't pass `gen` argument to `rand_like` function, which is also probably wrong - can you please take a look? What would be the correct way to generate a tensor filled with uniformly distributed number using provided `gen`?  