开发者
资源
[object Object]

[object Object][object Object]undefined
[object Object]
  • 接口功能:对输入张量列表的每个张量进行范数运算。
  • 计算公式:
    • [object Object]Atlas A2 训练系列产品/Atlas A2 推理系列产品[object Object]、[object Object]Atlas A3 训练系列产品/Atlas A3 推理系列产品[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)
    • Atlas 350 加速卡:

      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]

每个算子分为,必须先调用“aclnnForeachNormGetWorkspaceSize”接口获取入参并根据计算流程计算所需workspace大小,再调用“aclnnForeachNorm”接口执行计算。

[object Object]
[object Object]
[object Object]
  • 参数说明

    [object Object]
    • Atlas 350 加速卡:参数[object Object][object Object]支持的最大长度为256个。
  • 返回值

    aclnnStatus:返回状态码,具体参见

    第一段接口完成入参校验,出现以下场景时报错:

    [object Object]
[object Object]
  • 参数说明:

    [object Object]
  • 返回值:

    aclnnStatus:返回状态码,具体参见

[object Object]
  • 确定性计算:
    • aclnnForeachNorm默认确定性实现。
[object Object]

示例代码如下,仅供参考,具体编译和执行过程请参考

[object Object]