mars.tensor.random.
rand
Random values in a given shape.
Create a tensor of the given shape and populate it with random samples from a uniform distributionc over [0, 1).
[0, 1)
d0 (int, optional) – The dimensions of the returned tensor, should all be positive. If no argument is given a single Python float is returned.
d1 (int, optional) – The dimensions of the returned tensor, should all be positive. If no argument is given a single Python float is returned.
.. (int, optional) – The dimensions of the returned tensor, should all be positive. If no argument is given a single Python float is returned.
dn (int, optional) – The dimensions of the returned tensor, should all be positive. If no argument is given a single Python float is returned.
out – Random values.
Tensor, shape (d0, d1, ..., dn)
(d0, d1, ..., dn)
See also
random
Notes
This is a convenience function. If you want an interface that takes a shape-tuple as the first argument, refer to mt.random.random_sample .
Examples
>>> import mars.tensor as mt
>>> mt.random.rand(3, 2).execute() array([[ 0.14022471, 0.96360618], #random [ 0.37601032, 0.25528411], #random [ 0.49313049, 0.94909878]]) #random