Hello Nick!



 Nick_8229:

What you gave is fix seed for each RNG.


Not really.  Pytorch has (roughly speaking) a single global RNG.
This global RNG is used (drawing random number from its
current state) by things like torch.FloatTensor.normal_().
I simply reseeded the global RNG three times.


What I want is fix seed for each tensor, kind of like followings,


I’m not aware of any way to attach a per-tensor RNG to a specific
tensor.  (But you shouldn’t want to do this.)


zn = torch.FloatTensor(dim)
for i:
   zn[i].manual_seed(get_seed(i))
   zn[i].normal_()



This code suggests that you want to be able to attach a separate
(and separately seeded) RNG to each “row” of your tensor.   Is
that what you mean?
But, in any event, other than the (nominally irrelevant) actual values
of the randomly set elements of the tensor, how are the results of
your pseudocode (or what you are trying to achieve) intended to
differ from the results of the code I posted?  In both cases I see
the elements of your tensors being set to (pseudo) random values drawn from a normal distribution.
What – in terms of results – is it that you want that differs from
what my code snippet does?
Best.
K. Frank