Hi, All

I have an inquiry about creating a random noise tensor with the same size of existing tensor.

the python code is:

noise1=torch.randn(x.size())*0.3

but in C++, I cannot write like

torch::Tensor noise = torch::randn({x.size()}) * 0.3; it does not allow to have x.size()

as the size of tensor x is varying, I cannot explicit write down all the dimensions of x, is there a better way to handle it please ?

Any comments are welcome.

Thanks.