Baremetal-NN
Baremetal-NN API documentation
Loading...
Searching...
No Matches

◆ NN_rand()

Tensor * NN_rand ( size_t  ndim,
const size_t *  shape,
DataType  dtype 
)

Returns a tensor filled with random numbers from a uniform distribution.

The range of the random number is dependent on the data type:

  • For Float32, the range is [0, 1]
  • For Int8, the range is [0, 255]
  • For Int32, the range is [0, RAND_MAX]
Parameters
ndimnumber of dimensions
shapeshape of tensor
dtypedata type
Returns
Tensor