FilesLast commitLast update
17 days ago
2 months ago
18 days ago
2 days ago
2 months ago
3 months ago
5 months ago
19 days ago
9 days ago
README

LogAddExp

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: computes the logarithm of the sum of exponentials of two input tensors element-wise. Under the default attributes, the base is e.
  • Computation formula:

    y=ln⁡(ex1+ex2)y = \ln\left(e^{x_1} + e^{x_2}\right)

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
x1 Input Input tensor x_1 in the formula FLOAT16, BFLOAT16, FLOAT32 ND
x2 Input Input tensor x2 in the formula Same as x1 ND
base Optional attribute Base of the exponential and logarithm operations, with a default value of -1.0, indicating the base e FLOAT32 -
scale Optional attribute Scaling coefficient of -abs(x1-x2) in the exponential term, with a default value of 1.0 FLOAT32 -
shift Optional attribute Offset of the exponential term, with a default value of 0.0 FLOAT32 -
y Output Output tensor y in the formula Same as x1 ND

Constraint Description

  • base must be -1.0 or a value greater than 0.
  • The data types of x1, x2, and y must be the same.
  • The shapes of x1 and x2 must satisfy the broadcast relationship, and the shape of y is the shape after broadcasting.
  • Atlas inference products and Atlas training products do not support the BFLOAT16 data type.

Invocation Description

Invocation Method Invocation Sample Description
aclnn invocation test_aclnn_log_add_exp Invokes the LogAddExp operator through the aclnnLogAddExp API
aclnn invocation test_aclnn_log_add_exp2 Invokes the LogAddExp operator through the aclnnLogAddExp2 API