[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Computes the norm of each tensor in the input tensor list.
  • Formula:
    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]:

      x=[x0,x1,...xn1]x = [{x_0}, {x_1}, ... {x_{n-1}}]\\ y=(i=0n1xip)1p(i=0,1,...n1)y = \left(\sum_{i=0}^{n-1}|x_i|^{p}\right)^{\frac{1}{{p}}} (i=0,1,...n-1)
    • Ascend 950PR/Ascend 950DT:

      x=[x0,x1,...xn1]x = [{x_0}, {x_1}, ... {x_{n-1}}]\\
      • scalar = +Inf:

        y=maxxiy = \max|x_i|
      • int(scalar) = 1:

        y=i=0n1xiy = \sum_{i=0}^{n-1}|x_i|
      • other:

        y=(i=0n1xi2)12y = \left(\sum_{i=0}^{n-1}|x_i|^{2}\right)^{\frac{1}{{2}}}
[object Object]

Each operator has calls. First, aclnnForeachNormGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnForeachNorm is called to perform computation.

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

    [object Object]
    • Ascend 950PR/Ascend 950DT: The maximum length of the [object Object] and [object Object] parameters is 256 characters.
  • Returns

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

    The first-phase API implements input parameter validation. The following error codes may be returned.

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns

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

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

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

[object Object]