[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Returns a tensor where each sub-tensor of the input tensor self along the dimension dim is normalized so that the p-norm of the sub-tensor is less than maxNorm.

  • Formula:

    outputi={inputi,inputip<=maxNorminputiinputipmaxNorm,inputip>maxNormoutput_i=\left\{ \begin{aligned} input_i,\quad ||input_i||_p <= maxNorm \\ \frac {input_i} {||input_i||_p} \cdot maxNorm,\quad ||input_i||_p>maxNorm \end{aligned} \right.

    Where: ii is the tensor slice of a dimension determined by dim:

    inputip=(i=0ninputip1p)||input_i||_p = (\sum_{i=0}^{n}{input_i^p}^\frac{1}{p})
  • Example:

    [object Object]
[object Object]
  • aclnnRenorm and aclnnInplaceRenorm implement the same function in different ways. Select a proper operator based on your requirements.

    • aclnnRenorm: An output tensor object needs to be created to store the computation result.
    • aclnnInplaceRenorm: No output tensor object needs to be created, and the computation result is stored in the memory of the input tensor.
  • Each operator has calls. First, aclnnRenormGetWorkspaceSize or aclnnInplaceRenormGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnRenorm or aclnnInplaceRenorm is called to perform computation.

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

    [object Object]
    • [object Object]Atlas training products[object Object]: The data types of [object Object] and [object Object] cannot be BFLOAT16.
  • 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]
  • Parameters

    [object Object]
    • [object Object]Atlas training products[object Object]: The data type of [object Object] cannot be BFLOAT16.
  • 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:
    • aclnnRenorm defaults to a deterministic implementation.
    • aclnnInplaceRenorm defaults to a deterministic implementation.
[object Object]

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

  • aclnnRenorm sample code:

    [object Object]
  • aclnnInplaceRenorm sample code:

    [object Object]