Mojo function
randn
randn[dtype: DType](ptr: UnsafePointer[Scalar[dtype], address_space=address_space, alignment=alignment, origin=origin], size: Int, mean: Float64 = 0, standard_deviation: Float64 = 1)
Fills memory with random values from a Normal(mean, standard_deviation) distribution.
Constraints:
The type should be floating point.
Parameters:
- dtype (
DType
): The dtype of the pointer.
Args:
- ptr (
UnsafePointer
): The pointer to the memory area to fill. - size (
Int
): The number of elements to fill. - mean (
Float64
): Normal distribution mean. - standard_deviation (
Float64
): Normal distribution standard deviation.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!