flâneur — a map of the web's best reading

torch.normal — PyTorch 2.12 documentation

docs.pytorch.org · 516 words · saved by 1 readers

Returns a tensor of random numbers drawn from separate normal distributions whose mean and standard deviation are given. The mean is a tensor with the mean of each output element’s normal distribution The std is a tensor with the standard deviation of each output element’s normal distribution The shapes of mean and std don’t need to match, but the total number of elements in each tensor need to be the same. Note When the shapes do not match, the shape of mean is used as the shape for the returned output tensor Note When std is a CUDA tensor, this function synchronizes its device with the CPU. mean (Tensor) – the tensor of per-element means std (Tensor) – the tensor of per-element standard deviations generator (torch.Generator, optional) – a pseudorandom number generator for sampling out (Tensor, optional) – the output tensor. Example: Similar to the function above, but the means are shared among all drawn elements. mean (float, optional) – the mean for all distributions std (Tensor) –

torch.normal # torch. normal ( mean , std , * , generator = None , out = None ) → Tensor # Returns a tensor of random numbers drawn from separate normal distributions whose mean and standard deviation are given. The mean is a tensor with the mean of each output element’s normal distribution The std is a tensor with the standard deviation of each output element’s normal distribution The shapes of mean and std don’t need to match, but the total number of elements in each tensor need to be the same. Note When the shapes do not match, the shape of mean is used as the shape for the returned

Explore this link on the map →

related reading