mardi 9 août 2022

Pytorch: How to generate random vectors with length in a certain range?

I want a k by 3 by n tensor representing k batches of n random 3d vectors, each vector has a magnitude (Euclidean norm) between a and b. Other than rescaling the entries of a random kx3xn tensor to n random lengths in a for loop, is there a better/more idiomatic way to do this?




Aucun commentaire:

Enregistrer un commentaire