---
title: 使用场景
description: "- 通常使用在注意力机制attention前和attention与前馈网络ffn之间。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendtb/ascendtb_01_0246.html
sourcePath: /source/zh/canncommercial/900/API/ascendtb/ascendtb_01_0246.html
indexId: 7d748d793314a7c0c868eb27da84ba1c2a5d1c5f0352e502310353e949bc156664
---
# 使用场景

- 通常使用在注意力机制attention前和attention与前馈网络ffn之间。
  图1 RmsNormOperation算子上下文

- 参数“rstd”为“true”时使用场景

  - 输入：xDim:[8,8,8]; gammaDim:[8]; 输出：rstdDim:[8, 8, 1]| i | xDimNum \- gammaDimNum | condition(i >= (xDimNum \- gammaDimNum)) | rstdDimNum |
| --- | --- | --- | --- |
| 0 | 2 | false | xDim[0] |
| 1 | 2 | false | xDim[1] |
| 2 | 2 | true | 1 |


  - 输入：xDim:[8,8,8]; gammaDim:[8,8]; 输出：rstdDim:[8, 1, 1]| i | xDimNum \- gammaDimNum | condition(i >= (xDimNum \- gammaDimNum)) | rstdDimNum |
| --- | --- | --- | --- |
| 0 | 1 | false | xDim[0] |
| 1 | 1 | true | 1 |
| 2 | 1 | true | 1 |


  - 输入：xDim:[8,16,32]; gammaDim:[8,16,32]; 输出：rstdDim:[1, 1, 1]| i | xDimNum \- gammaDimNum | condition(i >= (xDimNum \- gammaDimNum)) | rstdDimNum |
| --- | --- | --- | --- |
| 0 | 0 | true | 1 |
| 1 | 0 | true | 1 |
| 2 | 0 | true | 1 |
