torch.normal — PyTorch 2.12 documentation
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
- torch.randn — PyTorch 2.12 documentationdocs.pytorch.org
- torch.Tensor.uniform_ — PyTorch 2.12 documentationdocs.pytorch.org
- torch.empty — PyTorch 2.12 documentationdocs.pytorch.org
- torch.Tensor — PyTorch 2.12 documentationdocs.pytorch.org
- PyTorch internals : ezyang's blogblog.ezyang.com
- torch.zeros_like — PyTorch 2.12 documentationdocs.pytorch.org
- torch.arange — PyTorch 2.12 documentationdocs.pytorch.org
- Tensors — PyTorch Tutorials 2.12.0+cu130 documentationpytorch.org
- Annotated Research Paper Implementations: Transformers, StyleGAN, Stable Diffusion, DDPM/DDIM, LayerNorm, Nucleus Sampling and morenn.labml.ai
- torch.var — PyTorch 2.12 documentationdocs.pytorch.org
- torch.ones_like — PyTorch 2.12 documentationdocs.pytorch.org
- torch.reshape — PyTorch 2.12 documentationdocs.pytorch.org