[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Returns the matrix norm or vector norm of a given tensor.

  • Formula: Supports the 1-norm, 2-norm, infinity norm, and other norms where p is a float value.

    • p = 1 norm:

      x=i=1Nxi\Vert x \Vert = \sum_{i=1}^{N}{\vert x_i \vert}
    • p = 2 norm (default value):

      x2=(i=1Nxi2)12\Vert x \Vert_2 = (\sum_{i=1}^{N}{\vert x_i \vert^2})^{\frac{1}{2}}
    • p = infinity norm:

      x=maxixi\Vert x \Vert_\infty = \max\limits_{i}{\vert x_i \vert} x=minixi\Vert x \Vert_{-\infty} = \min\limits_{i}{\vert x_i \vert}
    • p = other norms:

      xp=(i=1Nxip)1p\Vert x \Vert_p = (\sum_{i=1}^{N}{\vert x_i \vert^p})^{\frac{1}{p}}
[object Object]

Each operator has calls. First, aclnnNormGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnNorm is called to perform computation.

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

    [object Object]
  • Returns

    [object Object]: status code. For details, see .

    The first-phase API implements input parameter verification. The following errors may be thrown:

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns

    [object Object]: status code. For details, see .

[object Object]
  • Deterministic compute
    • aclnnNorm defaults to a non-deterministic implementation. You can call aclrtCtxSetSysParamOpt to enable deterministic compute.
[object Object]

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

[object Object]