function rand_(shape, randFunction, dtype) {
    (0, _utilBase.assertNonNegativeIntegerDimensions)(shape);
    const size = (0, _util.sizeFromShape)(shape);
    let values = null;
    if (dtype == null || dtype === "float32") values = new Float32Array(size);
    else if (dtype === "int32") values = new Int32Array(size);
    else if (dtype === "bool") values = new Uint8Array(size);
    else throw new Error(`Unknown data type ${dtype}`);
    for(let i = 0; i < size; i++)values[i] = randFunction();
    return (0, _engine.ENGINE).makeTensor(values, shape, dtype);
}
Creates a `tf.Tensor` with values sampled from a random number generator
function defined by the user.

@param shape An array of integers defining the output tensor shape.
@param randFunction A random number generator function which is called
for each element in the output tensor.
@param dtype The data type of the output tensor. Defaults to 'float32'.

@doc {heading: 'Tensors', subheading: 'Random'}