FilesLast commitLast update
4 days ago
4 days ago
3 months ago
4 days ago
10 months ago
5 days ago
2 months ago
7 days ago
7 days ago
5 days ago
1 month ago
6 days ago
README

Log

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 elements in the input tensor x element-wise, and saves the result to the output tensor y. It supports input tensors of multiple types and supports the scaling (shift/scale) operation on the input tensor x.

  • Computation formula:

    y=logbase(shift+scale∗x)y = log_{base}(shift + scale * x)

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
x Input Input tensor, which is x in the formula. INT8, INT16, INT32, INT64, UINT8, FLOAT16, FLOAT, DOUBLE
BOOL, BFLOAT16, COMPLEX64, COMPLEX128
ND
base Optional attribute
  • Base of the logarithm.
  • The default value is -1.0 (indicating the natural logarithm base e).
FLOAT -
scale Optional attribute
  • Scaling factor of the input tensor x.
  • The default value is 1.0.
FLOAT -
shift Optional attribute
  • Offset of the input tensor x.
  • The default value is 0.0.
FLOAT -
y Output Output tensor after the logarithm computation, which is y in the formula. If the input type is an integer type (INT type), the output type is FLOAT;
in other cases, the output type is the same as that of the input tensor x
ND

Constraint Description

  • The parameter base must be greater than 0. The default value -1 indicates the base e.
  • If the input value is in the specific range (0,0.01] or [0.95,1.05), the output precision may be unstable
  • Integer inputs are automatically converted to the FLOAT type for output

Invocation Description

Invocation Method Sample Code Description
aclnn invocation test_aclnn_log
test_aclnn_inplace_log
Invokes the Log operator through the aclnnLog or aclnnInplaceLog API.
aclnn invocation test_aclnn_log2
test_aclnn_inplace_log2
Invokes the Log operator through the aclnnLog2 or aclnnInplaceLog2 API.
aclnn invocation test_aclnn_log10
test_aclnn_inplace_log10
Invokes the Log operator through the aclnnLog10 or aclnnInplaceLog10 API.
Graph-mode invocation test_geir_log Invokes the Log operator by building a graph through the operator IR.