FilesLast commitLast update
15 days ago
2 months ago
4 months ago
15 days ago
1 month ago
15 days ago
1 month ago
25 days ago
12 days ago
README

BesselI1e

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 √

Note: This repository delivers the Ascend C implementation (registered for ascend950, ascend910_93, and ascend910b), which supports Ascend 950PR&950DT products, Atlas A3 products, and Atlas A2 products; the Atlas 200I/500 A2 inference products, Atlas inference products, and Atlas training products are supported through the built-in operator implementation of CANN. Together, they constitute the product coverage in the preceding table.

Function Description

  • Operator function: computes the exponentially scaled modified Bessel function of the first kind of order one, calculated element-wise on the input tensor x. The computation formula is:

yi=e−∣xi∣⋅I1(xi)y_i = e^{-|x_i|} \cdot I_1(x_i)

where xx is the input tensor (input parameter x in the parameter table), yy is the output tensor (output parameter y in the parameter table), and I1(x)I_1(x) is the modified Bessel function of the first kind of order one. The exponential scaling factor e−∣x∣e^{-|x|} keeps the function numerically stable for large parameter values.

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
x Input Input parameter for the BesselI1e computation. FLOAT, FLOAT16, BF16 ND
y Output Output parameter for the BesselI1e computation. FLOAT, FLOAT16, BF16 ND

Constraint Description

  • Atlas training products, Atlas inference products, and Atlas 200I/500 A2 inference products: the data type BFLOAT16 is not supported.
  • The output data type and shape are inferred by the framework based on the input, and the data format is ND.
  • Dynamic shapes and dynamic ranks are supported (both -1 for an unknown dimension and -2 for an unknown rank are supported, the shape dimensions can be determined at runtime, and the rank supports 0 to 8 dimensions).
  • 0-dimensional scalars and empty tensors are supported (when the number of elements is 0, the output is an empty tensor).
  • A non-contiguous tensor input is automatically converted into a contiguous tensor by the framework before execution.
  • When the input is FLOAT16 or BF16, the computation is performed in FLOAT internally in the operator, and the output is converted back to the input data type.
  • Output semantics for special input values: NaN is output when the input is NaN; 0 is output when the input is ±Inf; 0 is output when the input is ±0.
  • The GE graph-mode invocation is supported, and no aclnn operator API is provided; the TensorFlow graph mode is invoked through the framework plugin adaptation. For details, see the "Third-Party Framework Compatibility" section below.

Invocation Description

Invocation Method Sample Code Description
GE graph mode test_geir_bessel_i1e Invokes the BesselI1e operator by building a graph through the operator IR.
GE graph mode test_geir_bessel_i1e_dynamic Invokes the BesselI1e operator by building a dynamic graph through the operator IR, demonstrating the scenarios of -1 for an unknown dimension and -2 for an unknown rank.

Third-Party Framework Compatibility

  • This operator corresponds to the tf.math.bessel_i1e operator of TensorFlow. The framework plugin adaptation has been delivered (framework/bessel_i1e_tf_plugin.cpp), and in the TensorFlow graph mode, calls are automatically mapped to this operator.
  • TensorFlow invocation guide: After installing the TF-Ascend adaptation layer (npu_device) that matches the CANN version, call the operator through the tf.math.bessel_i1e / tf.raw_ops.BesselI1e APIs. Environment prerequisite: the npu_supported_ops.json file in the host environment has declared the BesselI1e operator mapping (in a clean environment, confirm that this declaration is delivered with the package or manually configure it).