Functions to create arrays

-> ArrayFire Documentation

TOC

randu()

Create a random array sampled from uniform distribution.

Arguments:

Result: the created AFArray instance.

randU()

alias of randu()

randn()

Create a random array sampled from normal distribution.

Arguments:

Result: the created AFArray instance.

randN()

alias of randn()

identity()

Create an identity matrix (array with diagonal values 1).

Arguments:

Result: the created AFArray instance.

range()

Creates an array with [0, n] values along the seqDim which is tiled across other dimensions.

Arguments:

Result: the created AFArray instance.

iota()

Create an sequence [0, dims.elements - 1] and modify to specified dimensions dims and then tile it according to tileDims.

Arguments:

- **dims: Array Dim4** - specifies sizes of the dimensions, eg: [2, 1, 1] or new Dim4(3, 4)
- type: value of dType - can be one of the values of dType object (eg. dType.f32)

Result: the created AFArray instance.

diag()

Extract diagonal from a matrix when extract is set to true.

Create a diagonal marix from input array when extract is set to false.

Arguments:

constant()

Create an array filled with the specified value.

Arguments:

Result: the created AFArray instance.