mars.tensor.random.standard_exponential

mars.tensor.random.standard_exponential(size=None, chunk_size=None, gpu=None, dtype=None)[源代码]

Draw samples from the standard exponential distribution.

standard_exponential is identical to the exponential distribution with a scale parameter of 1.

参数
  • size (int or tuple of ints, optional) – Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. Default is None, in which case a single value is returned.

  • chunk_size (int or tuple of int or tuple of ints, optional) – Desired chunk size on each dimension

  • gpu (bool, optional) – Allocate the tensor on GPU if True, False as default

  • dtype (data-type, optional) – Data-type of the returned tensor.

返回

out – Drawn samples.

返回类型

float or Tensor

实际案例

Output a 3x8000 tensor:

>>> import mars.tensor as mt
>>> n = mt.random.standard_exponential((3, 8000))