StatelessExponential
English | 简体中文
Product Support Status
| Product | Supported |
|---|---|
| Ascend 950PR&950DT products | √ |
| Atlas A3 products | × |
| Atlas A2 products | × |
| Atlas 200I/500 A2 inference products | × |
| Atlas inference products | × |
| Atlas training products | × |
Function Description
-
Operator function: generates random numbers that follow the exponential distribution with the parameter
lambdbased on the Philox4x32-10 PRNG, and fills the input tensorselfin place with random numbers that follow theExp(lambd)distribution. This operator is an internal service operator used by the without-replacement sampling path of theaclnnMultinomialTensorAPI on Ascend 950 (it generates exponentially distributed random perturbations for the subsequentdiv + argmax/topkto complete without-replacement multinomial sampling). -
Computation formula:
x=−1λln(u),u∼U(0,1]x = -\frac{1}{\lambda} \ln(u), \quad u \sim U(0, 1]
Here,
uis generated by the Philox4x32-10 PRNG, andlambd > 0is the rate parameter of the exponential distribution.
Parameter Description
| Parameter Name | Input/Output/Attribute | Description | Data Type | Data Format |
|---|---|---|---|---|
| self | Input/Output | Tensor to be filled (written in place), which determines the total number of generated random numbers and the output dtype; ≤8 dimensions. | FLOAT16, BFLOAT16, FLOAT | ND |
| seed | Input | Seed of the random number generator, which affects the generated random number sequence. | INT64 | ND |
| offset | Input | Offset of the random number generator, which must be a multiple of 4. | INT64 | ND |
| lambd | Attribute | Rate parameter λ of the exponential distribution, which must be greater than 0. | FLOAT | - |
Constraint Description
selfsupports only FLOAT16/BFLOAT16/FLOAT, the ND format, and at most 8 dimensions; non-contiguous inputs are converted to contiguous ones by AutoContiguous.lambdmust be > 0.offsetmust be a multiple of 4.- Only Ascend 950 is supported. Graph building (op_graph), the L2 APIs, and non-contiguous tensors are not supported.
Invocation Description
| Invocation Method | Sample Code | Description |
|---|---|---|
| aclnn invocation | test_aclnn_multinomial_tensor | The StatelessExponential service operator is invoked internally when the computation flow is built through the aclnnMultinomialTensor API. |
| aclnn invocation | test_aclnn_stateless_exponential | Invokes the StatelessExponential operator through the aclnnStatelessExponentialTensor API. |