[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Returns the corrected result of the input tensor for the specified indices based on the given maxNorm and normType.

  • Formula for vector norm, where p indicates the norm type specified by normType:

    Xp=i=1nxipp||X||_{p}=\sqrt[p]{\sum_{i=1}^nx_{i}^p} WhereX=(x1,x2,...,xn),xn)Where X = (x_{1}, x_{2}, ..., x_{n}), x_{n})

    If the computed norm is greater than maxNorm, normalization is applied by multiplying the elements along the zeroth dimension specified by indices by the following coefficient:

    scalar=maxNormcurrentNorm+1e7scalar = \frac{maxNorm}{currentNorm+1e^{-7}}
[object Object]

Each operator has calls. First, aclnnEmbeddingRenormGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation flow. Then, aclnnEmbeddingRenorm is called to perform computation.

  • [object Object]
  • [object Object]
[object Object]
  • Parameters

    • selfRef (aclTensor*, input/output): input tensor for the renorm operation, corresponding to x in the formula. The number of dimensions must be exactly 2. This is a device-side aclTensor. The can be ND. are supported.
      • [object Object]Atlas training series products[object Object]: The data type can be FLOAT or FLOAT16.
      • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type can be FLOAT, FLOAT16, or BFLOAT16.
    • indices (aclTensor*, input): indices along the zeroth dimension of selfRef to be processed by the renorm operation. This is a device-side aclTensor. The shape can contain a maximum of eight dimensions. The data type can be INT32 or INT64, and the can be ND. are supported. Index values must not be out of bounds.
    • maxNorm (double, input): maximum norm. If the computed norm exceeds this value, the embedding result is normalized. The data type must be DOUBLE.
    • normType (double, input): type of the L_P norm, corresponding to p in the formula. The data type must be DOUBLE.
    • workspaceSize (uint64_t*, output): size of the workspace to be allocated on the device.
    • executor (aclOpExecutor**, output): operator executor, containing the operator computation flow.
  • Returns

    aclnnStatus: status code. For details, see .

[object Object]
[object Object]
  • Parameters

    • workspace (void*, input): address of the workspace to be allocated on the device.
    • workspaceSize (uint64_t, input): size of the workspace to be allocated on the device, which is obtained by calling the first-phase API aclnnEmbeddingRenormGetWorkspaceSize.
    • executor (aclOpExecutor*, input): operator executor, containing the operator computation flow.
    • stream (aclrtStream, input): stream for executing the task.
  • Returns

    aclnnStatus: status code. For details, see .

[object Object]
  • Deterministic computation:
    • aclnnEmbeddingRenorm defaults to a deterministic implementation.
[object Object]

The following example is for reference only. For details, see .

[object Object]