Create a random array sampled from a normal distribution. More...

Functions

AFAPI array randn (const dim4 &dims, const dtype ty=f32)
 
AFAPI array randn (const dim_t d0, const dtype ty=f32)
 
AFAPI array randn (const dim_t d0, const dim_t d1, const dtype ty=f32)
 
AFAPI array randn (const dim_t d0, const dim_t d1, const dim_t d2, const dtype ty=f32)
 
AFAPI array randn (const dim_t d0, const dim_t d1, const dim_t d2, const dim_t d3, const dtype ty=f32)
 
AFAPI af_err af_randn (af_array *out, const unsigned ndims, const dim_t *const dims, const af_dtype type)
 

Detailed Description

Create a random array sampled from a normal distribution.

The distribution is centered around 0

Function Documentation

AFAPI af_err af_randn ( af_array out,
const unsigned  ndims,
const dim_t *const  dims,
const af_dtype  type 
)
Parameters
[out]outis the generated array
[in]ndimsis size of dimension array dims
[in]dimsis the array containing sizes of the dimension
[in]typeis the type of array to generate
AFAPI array af::randn ( const dim4 dims,
const dtype  ty = f32 
)
Parameters
[in]dimsis the dimensions of the array to be generated
[in]tyis the type of the array
Returns
array of size dims
Examples:
financial/heston_model.cpp, financial/monte_carlo_options.cpp, graphics/gravity_sim.cpp, and graphics/plot2d.cpp.
AFAPI array af::randn ( const dim_t  d0,
const dtype  ty = f32 
)
Parameters
[in]d0is the size of the first dimension
[in]tyis the type of the array
Returns
array of size d0
AFAPI array af::randn ( const dim_t  d0,
const dim_t  d1,
const dtype  ty = f32 
)
Parameters
[in]d0is the size of the first dimension
[in]d1is the size of the second dimension
[in]tyis the type of the array
Returns
array of size d0 x d1
AFAPI array af::randn ( const dim_t  d0,
const dim_t  d1,
const dim_t  d2,
const dtype  ty = f32 
)
Parameters
[in]d0is the size of the first dimension
[in]d1is the size of the second dimension
[in]d2is the size of the third dimension
[in]tyis the type of the array
Returns
array of size d0 x d1 x d2
AFAPI array af::randn ( const dim_t  d0,
const dim_t  d1,
const dim_t  d2,
const dim_t  d3,
const dtype  ty = f32 
)
Parameters
[in]d0is the size of the first dimension
[in]d1is the size of the second dimension
[in]d2is the size of the third dimension
[in]d3is the size of the fourth dimension
[in]tyis the type of the array
Returns
array of size d0 x d1 x d2 x d3