torch.func._random.normal_#
- torch.func._random.normal_(key, result, *, mean=0.0, std=1.0)[source]#
Fill
resultin-place with normal random values from a PRNG key.The values are drawn from a normal distribution with the specified
meanandstd. The output is fully determined by the key, so calling with the same key always produces the same result.Supports batched keys: if
keyhas shape(*batch, K), the leading dimensions ofresultmust be broadcastable with*batchand each key independently generates its slice of the output.- Parameters:
- Returns:
result, filled with normal random values.- Return type:
Example:
>>> key = torch.func._random.key(42, device="cuda") >>> result = torch.empty(1000, device="cuda") >>> torch.func._random.normal_(key, result)