FilesLast commitLast update
23 days ago
4 months ago
3 months ago
2 months ago
4 months ago
8 days ago
2 months ago
19 days ago
8 days ago
1 month ago
17 days ago
README

Embedding

English | 简体中文

Applicable Products

Product Support
Ascend 950PR&950DT products √
Atlas A3 products ×
Atlas A2 products ×
Atlas 200I/500 A2 inference products ×
Atlas inference products ×
Atlas training products ×

Function

  • Operator function: Maps a data set into a vector space, thereby quantizing the data. The 2D weight tensor of embedding is weight (m+1 rows, n columns). For any input index tensor indices (such as 1 row and 3 columns), the output out is a tensor of 3 rows and n columns, as shown below:

weight=[x01x02...x0nx11x12...x1nx21x22...x2n...xm1xm2...xmn]indices=[0,2,m]out=[x01x02...x0nx21x22...x2nxm1xm2...xmn]\begin{aligned} & weight = \begin{bmatrix} x_{01} & x_{02} & ... & x_{0n}\\ x_{11} & x_{12} & ... & x_{1n}\\ x_{21} & x_{22} & ... & x_{2n}\\ ...\\ x_{m1} & x_{m2} & ... & x_{mn}\\ \end{bmatrix}\\ & indices = \begin{bmatrix} 0,2,m \end{bmatrix}\\ & out = \begin{bmatrix} x_{01} & x_{02} & ... & x_{0n}\\ x_{21} & x_{22} & ... & x_{2n}\\ x_{m1} & x_{m2} & ... & x_{mn}\\ \end{bmatrix}\\ \end{aligned}

Parameters

Parameter name Input/Output/Attribute Description Data type Data format
weight Input The original input BF16, FLOAT16, FLOAT, UINT8, INT8, UINT16, INT16, UINT, INT, INT64, UINT64, BOOL, DOUBLE, COMPLEX64, COMPLEX32 ND
indices Input The index values INT64, INT ND
out Output The result after indexing BF16, FLOAT16, FLOAT, UINT8, INT8, UINT16, INT16, UINT, INT, INT64, UINT64, BOOL, DOUBLE, COMPLEX64, COMPLEX32 ND

Constraints

None

Invocation Description

Invocation method Sample code Description
aclnn test_aclnn_embedding Calls the Embedding operator through the aclnn interface.