mindspore.Tensor.exponential_

View Source On Gitee
Tensor.exponential_(lambd=1, *, generator=None)[source]

Fills self tensor with elements drawn from the exponential distribution:

\[f(x) = \lambda \exp(-\lambda x)\]

Warning

  • It is only supported on Atlas A2 Training Series Products.

  • This is an experimental API that is subject to change or deletion.

Parameters

lambd (float, optional) – Parameters of exponential distribution. Default: 1.

Keyword Arguments

generator (Generator, optional) – a pseudorandom number generator. Default: None .

Returns

Tensor, with same shape and same data type with input.

Supported Platforms:

Ascend

Examples

>>> import mindspore
>>> x = mindspore.Tensor([1, 2, 3.0])
>>> out = x.exponential_(2)
>>> print(out.shape)
(3,)