<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[雲間録]]></title><description><![CDATA[世界を少しだけ記録する]]></description><link>https://hyli.xyz</link><image><url>https://hyli.xyz/favicon.svg</url><title>雲間録</title><link>https://hyli.xyz</link></image><generator>Shiro (https://github.com/Innei/Shiro)</generator><lastBuildDate>Mon, 20 Apr 2026 01:28:21 GMT</lastBuildDate><atom:link href="https://hyli.xyz/feed" rel="self" type="application/rss+xml"/><pubDate>Mon, 20 Apr 2026 01:28:21 GMT</pubDate><language><![CDATA[zh-CN]]></language><item><title><![CDATA[Transformer Fundamentals]]></title><description><![CDATA[<link rel="preload" as="image" href="https://s.hyli.xyz/img/2026/04/01/1775055808.png"/><link rel="preload" as="image" href="https://s.hyli.xyz/img/2026/04/01/1775055823.png"/><link rel="preload" as="image" href="https://s.hyli.xyz/img/2026/04/01/1775055827.png"/><div><blockquote>该渲染由 Shiro API 生成，可能存在排版问题，最佳体验请前往：<a href="https://hyli.xyz/posts/notes/transformer-fundamentals">https://hyli.xyz/posts/notes/transformer-fundamentals</a></blockquote><div><h2 id="">核心目标</h2><ul><li>为什么用多头注意力</li><li>Q / K / V 分别在做什么</li><li>attention 为什么用点乘、为什么要 scaled</li><li>Encoder / Decoder 的结构分别是什么</li><li>位置编码、残差、LayerNorm、BatchNorm、前馈网络分别起什么作用</li><li>decoder-only 模型是怎么一步一步生成新 token 的</li><li>encoder-only、decoder-only、encoder-decoder 各适合什么任务</li></ul><h2 id="">架构图</h2><p>引用自 <a href="https://github.com/An-Jhon/Hand-Drawn-Transformer">https://github.com/An-Jhon/Hand-Drawn-Transformer</a></p><h2 id="transformer">Transformer</h2><p><img src="https://s.hyli.xyz/img/2026/04/01/1775055808.png" alt="Transformer-Decoder" height="16384" width="9958"/></p><h2 id="transformer-encoder">Transformer-Encoder</h2><p><img src="https://s.hyli.xyz/img/2026/04/01/1775055823.png" alt="Transformer-Encoder"/></p><h2 id="transformer-decoder">Transformer-Decoder</h2><p><img src="https://s.hyli.xyz/img/2026/04/01/1775055827.png" alt="Transformer-Decoder"/></p><hr/><h2 id="">多头注意力</h2><h3 id="">为什么使用多头注意力，而不是一个头</h3><p>多头注意力的核心作用是：<strong>让模型在不同表示子空间里并行地关注不同类型的关系</strong>。</p><p>单头注意力当然也能工作，但它只能学到一套注意力模式。
多头注意力则可以让不同 head 分别关注不同的信息，比如：</p><ul><li>有的 head 更关注近距离依赖</li><li>有的 head 更关注长距离依赖</li><li>有的 head 更关注句法关系</li><li>有的 head 更关注实体之间的对应关系</li></ul><p>所以，多头注意力并不是“把一个头简单复制很多份”，而是给模型提供了<strong>并行的、多视角的关系建模能力</strong>。原始 Transformer 论文明确说明，多头注意力可以让模型同时在不同表示子空间中关注信息，而单头注意力会削弱这种能力。</p><h3 id="-q--k-">为什么 Q 和 K 使用不同的权重矩阵，而不是直接自己和自己点乘</h3><p>Q 和 K 虽然都来自输入表示，但它们承担的角色不同：</p><ul><li><strong>Q（Query）</strong>：当前 token 想找什么</li><li><strong>K（Key）</strong>：每个 token 提供什么可被匹配的信息</li><li><strong>V（Value）</strong>：匹配成功后真正取走的内容</li></ul><p>如果 Q 和 K 使用同一个投影矩阵，那 attention score 更接近一种“自相似度”计算，表达能力会受限。
而把 Q 和 K 分开，模型就能学习更灵活的匹配关系，也就是：</p><ul><li>查询空间和键空间可以不同</li><li>匹配关系不必对称</li><li>不同 head 也能学出不同的匹配模式</li></ul><p>原始论文就是分别使用 (W^Q)、(W^K)、(W^V) 三组矩阵。</p><h3 id="-attention-">为什么 attention 选择点乘而不是加法</h3><p>常见的 attention 打分方式有两类：</p><ul><li><strong>加法注意力（additive attention）</strong></li><li><strong>点乘注意力（dot-product attention）</strong></li></ul><p>Transformer 选择点乘注意力，主要原因是：</p><ol start="1"><li><strong>更适合矩阵乘法并行</strong></li><li><strong>在 GPU/TPU 上实现效率更高</strong></li><li><strong>和多头注意力结构更匹配</strong></li></ol><p>原始论文明确比较过这两种方式，并指出两者理论复杂度类似，但点乘注意力在实践中更快、更省计算，因为它能直接利用高效的矩阵乘法实现。</p><hr/><h2 id="scaled-dot-product-attention">Scaled Dot-Product Attention</h2><h3 id="-softmax--sqrtdk">为什么 softmax 之前要除以 (\sqrt{d_k})</h3><p>attention 的原始分数来自：</p><p>[
QK^T
]</p><p>如果 (Q) 和 (K) 的每个分量都满足均值为 0、方差为 1，那么它们点积后的方差大约会随着维度 (d<em>k) 增大而增大。
也就是说，(d</em>k) 越大，attention score 的数值通常越大。</p><p>这样会带来一个问题：</p><ul><li>softmax 输入太大</li><li>softmax 输出会变得非常极端</li><li>很多位置接近 0 或 1</li><li>梯度变小，训练不稳定</li></ul><p>所以 Transformer 在 softmax 之前会做：</p><p>[
\frac{QK^T}{\sqrt{d_k}}
]</p><p>这样做的效果是把 score 的尺度压回更稳定的范围，让 softmax 不容易饱和。原始论文明确给出了这个解释。</p><h3 id="-padding--mask">如何对 padding 做 mask</h3><p>padding mask 的作用是：<strong>屏蔽掉那些只是补齐长度、并不是真实 token 的位置</strong>。</p><p>常见做法是在 softmax 之前，把 padding 位置对应的 attention score 设成一个极小值（理论上写作 (-\infty)）：</p><ul><li>有效 token：保留原分数</li><li>padding token：设为 (-\infty)</li></ul><p>这样经过 softmax 之后，padding 位置的权重就会变成 0。
这里要区分两种 mask：</p><ul><li><strong>padding mask</strong>：遮掉 pad</li><li><strong>causal mask / sequence mask</strong>：遮掉未来 token</li></ul><p>这两者不是一回事。原始论文在 decoder 里写到，用 mask 把非法连接设为 (-\infty)；padding mask 也是同样思想。</p><hr/><h2 id="">多头注意力里的降维</h2><h3 id="-head-">为什么每个 head 要降维</h3><p>多头注意力通常把总 hidden dim 切成多个 head，每个 head 只负责其中一部分维度。</p><p>原因有两个：</p><ol start="1"><li><p><strong>保持总计算量不过度膨胀</strong>
如果 8 个 head 每个都还用完整维度，那参数量和计算量都会暴涨。</p></li><li><p><strong>让每个 head 在自己的子空间里专门化</strong>
每个 head 只看一部分维度，更容易学到不同类型的关系。</p></li></ol><p>原始论文中，每个 head 的维度通常设为 (d_{model}/h)，这样多头后的总计算量与单头全维 attention 大致在同一数量级。</p><hr/><h2 id="encoder--decoder-">Encoder 和 Decoder 结构</h2><h3 id="encoder-">Encoder 模块是什么</h3><p>原始 Transformer 的一个 Encoder block 结构是：</p><pre class="language-text lang-text"><code class="language-text lang-text">Multi-Head Self-Attention
-&gt; Add &amp; LayerNorm
-&gt; Position-wise Feed-Forward Network
-&gt; Add &amp; LayerNorm
</code></pre>
<p>在进入 Encoder stack 之前，输入还会先经过：</p><pre class="language-text lang-text"><code class="language-text lang-text">token embedding + positional encoding
</code></pre>
<p>所以更完整的结构是：</p><pre class="language-text lang-text"><code class="language-text lang-text">token ids
-&gt; embedding + positional encoding
-&gt; N 层 Encoder blocks
</code></pre>
<p>其中每个 block 做两件事：</p><ol start="1"><li>让每个 token 和整个输入序列做 self-attention</li><li>再用逐位置前馈网络做非线性变换</li></ol><p>原始论文里的 Encoder 就是这样定义的。</p><h3 id="encoder--decoder-">Encoder 端和 Decoder 端如何交互</h3><p>在原始的 encoder-decoder Transformer 中，decoder block 有三部分：</p><ol start="1"><li>masked self-attention</li><li>encoder-decoder attention</li><li>feed-forward network</li></ol><p>其中第二部分就是 Encoder 和 Decoder 的交互点。</p><p>这里一定要记清：</p><ul><li><strong>Q 来自 decoder 当前层表示</strong></li><li><strong>K 和 V 来自 encoder 输出</strong></li></ul><p>也就是说，decoder 会先根据已经生成的前缀形成自己的查询表示，然后再去“读取”encoder 编码后的输入信息。原始论文明确是这样定义 cross-attention 的。</p><h3 id="decoder--encoder-">Decoder 自注意力和 Encoder 自注意力有什么区别</h3><p>两者核心形式相同，但有一个关键区别：</p><ul><li><strong>Encoder self-attention</strong>：通常可以看到整个输入序列</li><li><strong>Decoder self-attention</strong>：必须加 causal mask，只能看到当前位置及之前的 token</li></ul><p>为什么 decoder 必须这样做？
因为 decoder 是自回归生成模型，在训练时它的目标是“根据前文预测下一个 token”。如果当前位置能看到未来 token，就会信息泄露。原始论文明确指出，decoder 需要 mask 掉后续位置。</p><hr/><h2 id="">并行化</h2><h3 id="transformer-">Transformer 的并行化体现在哪里</h3><p>Transformer 相比 RNN 的一个重要优势是：<strong>在训练时，整个序列的很多位置可以并行计算</strong>。</p><p>例如：</p><ul><li>self-attention 可以一次算出一整个序列的关系</li><li>前馈网络可以对所有位置并行做变换</li></ul><p>这和 RNN 不一样。RNN 必须按时间步一步一步往后算，而 Transformer 在训练时可以把整段序列一起送进去。原始论文也把“更强的并行化能力”列为 Transformer 的重要优点。</p><h3 id="decoder-">Decoder 可以并行化吗</h3><p>要分开看：</p><p><strong>训练时可以并行化。</strong>
因为训练通常使用 teacher forcing，整个目标序列已知，模型可以一次性处理所有位置，只要用 causal mask 保证每个位置不能偷看未来。</p><p><strong>推理时不能跨时间步完全并行。</strong>
因为推理是自回归生成：</p><ul><li>先生成第 1 个新 token</li><li>再基于它生成第 2 个</li><li>再生成第 3 个</li></ul><p>所以推理时跨 token 仍然是串行的，只能在“单步内部”并行。KV cache 可以减少重复计算，但不能把生成过程变成完全并行。Hugging Face 对 KV cache 的说明也明确强调，生成是 token by token 的。</p><hr/><h2 id="">词向量和位置编码</h2><h3 id="-sqrtdmodel">为什么输入词向量后要乘以 (\sqrt{d_{model}})</h3><p>你之前的理解是反的。
原始 Transformer 论文写的是：<strong>embedding 之后要乘以 (\sqrt{d_{model}})</strong>，也就是放大，而不是缩小。</p><p>直觉上可以这样理解：</p><ul><li>embedding 本身的尺度可能偏小</li><li>后面还要与 positional encoding 相加</li><li>乘上 (\sqrt{d_{model}}) 可以让 token embedding 的量级更合适</li></ul><p>这里要注意，原论文并没有像解释 scaled attention 那样给出详细数学推导，所以这个点你知道“做了什么”和“大致为什么这样做”就够了。</p><h3 id="">什么是位置编码，它有什么意义</h3><p>self-attention 本身并不天然感知顺序。
如果不给模型提供位置信息，那么“猫追狗”和“狗追猫”只看 token 集合可能非常接近，但它们的语义显然不同。</p><p>所以 Transformer 需要显式注入位置信息。
原始 Transformer 的做法是：</p><pre class="language-text lang-text"><code class="language-text lang-text">input representation = token embedding + positional encoding
</code></pre>
<p>也就是把位置编码直接加到输入 embedding 上。它的意义是：</p><ul><li>让模型知道 token 的先后顺序</li><li>让 attention 能区分不同位置的关系</li></ul><p>原始论文使用的是固定的 sinusoidal positional encoding。</p><h3 id="">位置编码的优缺点</h3><p><strong>优点：</strong></p><ul><li>结构简单</li><li>不依赖 RNN / CNN 就能表达顺序</li><li>易于和 attention 结构结合</li></ul><p><strong>缺点：</strong></p><ul><li>原始绝对位置编码对相对距离关系表达不够直接</li><li>更长上下文的外推能力有限</li><li>后来很多工作因此提出了更灵活的位置编码方式</li></ul><hr/><h2 id="">其它位置编码技术</h2><p>除了原始 Transformer 的绝对位置编码，还有很多后续方案。</p><h3 id="learned-absolute-positional-embedding">Learned absolute positional embedding</h3><p>直接学习每个位置的向量表示。</p><p><strong>优点：</strong></p><ul><li>模型自己学位置表示</li></ul><p><strong>缺点：</strong></p><ul><li>超出训练长度时外推能力通常较弱</li></ul><h3 id="relative-positional-encoding">Relative positional encoding</h3><p>不直接强调“绝对第几个位置”，而强调 token 之间的相对距离。Shaw 等人的工作就是代表。</p><p><strong>优点：</strong></p><ul><li>更自然地表达相对距离关系</li></ul><p><strong>缺点：</strong></p><ul><li>实现更复杂</li></ul><h3 id="roperotary-position-embedding">RoPE（Rotary Position Embedding）</h3><p>把位置信息编码进 Q/K 的旋转中。RoFormer 明确把它作为一种能将相对位置信息自然融入 self-attention 的方法。</p><p><strong>优点：</strong></p><ul><li>对相对位置建模更自然</li><li>现代 LLM 常用</li></ul><p><strong>缺点：</strong></p><ul><li>长上下文外推效果和具体频率设计有关</li></ul><h3 id="alibi">ALiBi</h3><p>不把位置编码加到 embedding 上，而是直接给 attention score 加线性距离偏置。ALiBi 的论文强调它在长度外推上表现不错。</p><p><strong>优点：</strong></p><ul><li>简单</li><li>长上下文外推效果好</li><li>不需要显式位置 embedding</li></ul><p><strong>缺点：</strong></p><ul><li>表达方式更偏“距离偏置”，不是传统 embedding 形式</li></ul><hr/><h2 id="layernormbatchnorm">残差结构、LayerNorm、BatchNorm</h2><h3 id="">什么是残差结构，它有什么意义</h3><p>Transformer 在每个子层外面都加了残差连接，然后再做 LayerNorm，也就是论文里的 “Add &amp; Norm”。</p><p>如果一个子层输出是 (F(x))，那么残差大致可以理解成：</p><p>[
x + F(x)
]</p><p>它的意义是：</p><ul><li>让原始信息更容易跨层传递</li><li>让梯度更容易传播</li><li>缓解深层网络训练困难</li></ul><p>原始论文明确在每个子层外用了 residual connection followed by layer normalization。</p><h3 id="-transformer--layernorm--batchnorm">为什么 Transformer 用 LayerNorm 而不是 BatchNorm</h3><p>这里要纠正一个常见误解：</p><ul><li><strong>BatchNorm</strong> 依赖 batch 的均值和方差</li><li><strong>LayerNorm</strong> 不依赖 batch 统计量，而是对单个样本的隐藏维度做归一化</li></ul><p>LayerNorm 论文明确指出，BatchNorm 的效果依赖 mini-batch size，而 LayerNorm 在训练和测试时计算方式一致，更适合 RNN 和序列模型。</p><p>Transformer 选择 LayerNorm，主要因为：</p><ul><li>序列长度可能变化</li><li>batch size 可能较小</li><li>更希望 train/test 逻辑一致</li><li>不想依赖 batch 统计量</li></ul><h3 id="layernorm--transformer-">LayerNorm 在 Transformer 里的位置</h3><p>在原始 Transformer 中，LayerNorm 位于每个子层的残差相加之后，也就是：</p><pre class="language-text lang-text"><code class="language-text lang-text">SubLayer -&gt; Add -&gt; LayerNorm
</code></pre>
<p>也就是经典的 “Add &amp; Norm”。</p><h3 id="-batchnorm">什么是 BatchNorm，它的优缺点是什么</h3><p>BatchNorm 的做法是：</p><ul><li>用 mini-batch 的均值和方差对激活做归一化</li><li>再用可学习参数做缩放和平移</li></ul><p>BatchNorm 原论文说明，它能显著加快训练并提高效果。</p><p><strong>优点：</strong></p><ul><li>稳定训练</li><li>常可用更大学习率</li><li>在 CNN 中效果很好</li></ul><p><strong>缺点：</strong></p><ul><li>依赖 batch size</li><li>train/test 行为不同</li><li>对序列模型和小 batch 不够自然</li></ul><hr/><h2 id="">前馈网络</h2><h3 id="transformer-">Transformer 中的前馈网络是什么</h3><p>Transformer block 里除了 attention，还包含一个前馈网络（FFN）。</p><p>原始论文给出的形式是：</p><p>[
FFN(x) = \max(0, xW<em>1 + b</em>1)W<em>2 + b</em>2
]</p><p>也就是：</p><ul><li>第一层线性变换</li><li>ReLU 激活</li><li>第二层线性变换</li></ul><p>而且它是 <strong>position-wise</strong> 的，也就是说：
<strong>对每个 token 位置分别、独立地应用同一套前馈网络。</strong></p><h3 id="">前馈网络的意义和优缺点</h3><p>你可以把 Transformer block 分成两个职责：</p><ul><li>attention：负责 token 和 token 之间交互</li><li>FFN：负责单个 token 内部表示的非线性变换</li></ul><p><strong>优点：</strong></p><ul><li>简单</li><li>计算高效</li><li>给每个位置提供更强表达能力</li></ul><p><strong>缺点：</strong></p><ul><li>不直接建模 token 间关系</li><li>这部分必须由 attention 来负责</li></ul><hr/><h2 id="dropoutmask">学习率、Dropout、Mask</h2><h3 id="transformer-">Transformer 的学习率是怎么设定的</h3><p>原始 Transformer 并不是简单用固定学习率，而是用了非常经典的 <strong>Noam learning rate schedule</strong>：</p><p>[
lrate = d_{model}^{-0.5}\cdot \min(step^{-0.5},\ step \cdot warmup^{-1.5})
]</p><p>也就是：</p><ul><li>前期 warmup，学习率逐步升高</li><li>后期随 step 增大而逐步衰减</li></ul><p>论文中还明确写了 <code>warmup_steps = 4000</code>。优化器用的是 Adam。</p><h3 id="dropout-">Dropout 放在哪里？测试时要注意什么</h3><p>原始 Transformer 使用了 residual dropout：</p><ul><li>在每个子层输出上做 dropout，再进入 Add &amp; Norm</li><li>在 embedding 和 positional encoding 相加之后也做 dropout</li><li>base model 的 dropout rate 是 0.1</li></ul><p>测试/推理时要特别注意：</p><ul><li>必须切到 <code>model.eval()</code></li><li>否则 dropout 仍会随机丢弃部分激活</li><li>结果就会不稳定</li></ul><p>这点和你前面 PyTorch 学到的 <code>train()</code> / <code>eval()</code> 完全一致。</p><h3 id="-token--mask">残差结构会不会把未来 token 的信息绕过 mask，造成泄露？</h3><p>不会。</p><p>因为如果 masked self-attention 本身已经正确应用了 causal mask，那么它的输出里就不会包含未来 token 信息。残差连接只是把“当前位置已有的合法输入表示”加回来，并不会凭空引入未来信息。</p><p>所以：</p><ul><li>mask 限制的是 attention 子层的信息流</li><li>residual 只是保留当前位置已有表示</li><li>不会绕过 mask 造成未来信息泄露</li></ul><hr/><h2 id="-transformer-">三类 Transformer 架构</h2><h3 id="encoder-onlydecoder-onlyencoder-decoder-">encoder-only、decoder-only、encoder-decoder 的区别和典型应用</h3><h4 id="encoder-only">encoder-only</h4><p>特点是：输入序列里的每个位置通常都可以看到整个输入。
所以它更适合做“理解输入”的任务。</p><p>典型任务：</p><ul><li>文本分类</li><li>命名实体识别</li><li>抽取式问答</li></ul><p>典型模型：</p><ul><li>BERT</li><li>DistilBERT</li><li>ModernBERT</li></ul><h4 id="decoder-only">decoder-only</h4><p>特点是：当前位置只能看见自己和左边的 token。
所以天然适合自回归生成。</p><p>典型任务：</p><ul><li>文本续写</li><li>对话</li><li>通用文本生成</li></ul><p>典型模型：</p><ul><li>GPT</li><li>LLaMA</li><li>Gemma</li></ul><h4 id="encoder-decoder">encoder-decoder</h4><p>特点是：先由 encoder 编码输入，再由 decoder 在生成时通过 cross-attention 读取 encoder 输出。
最适合“输入一个序列，输出另一个序列”的任务。</p><p>典型任务：</p><ul><li>机器翻译</li><li>文本摘要</li><li>生成式问答</li></ul><p>典型模型：</p><ul><li>T5</li><li>BART</li><li>Marian</li></ul><hr/><h2 id="decoder-only--token">decoder-only 模型如何生成一个新 token</h2><h3 id="-token--decoder-only-transformer-">一个新 token 是怎么在 decoder-only Transformer 里被生成出来的</h3><p>这个过程最好分成两段看：</p><h3 id="prefill">第一步：prefill</h3><p>先把整段 prompt 输入模型。
模型会：</p><ol start="1"><li>tokenizer 把文本变成 token ids</li><li>token ids 经过 embedding</li><li>再经过多层 decoder-only Transformer block</li><li>同时把历史 token 的 K/V 缓存到 KV cache 里</li></ol><p>Hugging Face 对 KV cache 的说明明确指出，缓存历史 K/V 是为了避免自回归生成时重复计算上下文。</p><h3 id="-token">第二步：生成下一个 token</h3><p>在 prompt 前向结束后，模型会得到最后一个位置的 logits。
接着：</p><ol start="1"><li><p>从最后一个位置 logits 中选出下一个 token</p><ul><li>可以 greedy</li><li>可以 sampling</li><li>可以 beam search</li></ul></li><li>把这个 token 接到原前缀后面</li><li>再进入下一轮生成</li></ol><p>Hugging Face 的 generation 文档明确说，不同 decoding strategy 决定“下一个 token 怎么选”。</p><h3 id="">后续为什么不用把整段都重算一遍</h3><p>因为有 KV cache。</p><p>后续每一步只需要：</p><ol start="1"><li>输入新生成的那个 token</li><li>只为它计算新的表示和新的 K/V</li><li>把新的 K/V 接到历史 cache 后面</li><li>用当前 token 的 Q 和所有历史 K/V 做 attention</li><li>输出新的 logits</li><li>再选一个新 token</li></ol><p>所以 decoder-only 的生成本质是：</p><pre class="language-text lang-text"><code class="language-text lang-text">当前前缀
-&gt; 预测下一个 token
-&gt; 把这个 token 接回前缀
-&gt; 继续预测
</code></pre>
<p>这就是典型的自回归生成过程。KV cache 只是让这个过程更快，而不是改变它的本质。</p><hr/><h2 id="">还需要补充的两个问题</h2><h3 id="-ffn-position-wise">为什么 FFN 是逐位置（position-wise）的？</h3><p>因为 attention 已经负责了跨 token 的交互，而 FFN 的职责是对每个 token 的当前表示做统一的非线性变换。原始论文明确说 FFN 是对 each position separately and identically 应用的。</p><h3 id="-transformer--residual--layernorm">为什么 Transformer 同时需要 residual 和 LayerNorm？</h3><p>因为两者解决的问题不同：</p><ul><li>residual：帮助信息和梯度跨层传播</li><li>LayerNorm：稳定表示分布</li></ul><p>所以它们不是互相替代，而是组合使用，形成 “Add &amp; Norm”。原始 Transformer 就是这样设计的。</p><hr/><h2 id="">最重要的结论</h2><ol start="1"><li><strong>多头注意力的核心是：在不同表示子空间里并行建模不同关系。</strong></li><li><strong>Q 和 K 分开，是为了让查询空间和键空间解耦，表达更灵活的匹配关系。</strong></li><li><strong>scaled dot-product attention 里的 scaling，是为了让 softmax 输入更稳定。</strong></li><li><strong>Encoder 的 self-attention 通常全可见，Decoder 的 self-attention 必须因果遮罩。</strong></li><li><strong>LayerNorm 不依赖 batch 统计量，更适合 Transformer 这类序列模型。</strong></li><li><strong>Transformer block 的两大核心部分是 attention 和 FFN。</strong></li><li><strong>encoder-only 偏理解，decoder-only 偏生成，encoder-decoder 偏序列到序列转换。</strong></li><li><strong>decoder-only 生成新 token 的本质，是“根据当前前缀预测下一个 token，再把它接回去继续生成”。</strong></li></ol><h2 id="references">References</h2><h3 id="transformer-">Transformer 核心</h3><ul><li>Attention Is All You Need<br/><a href="https://papers.neurips.cc/paper/7181-attention-is-all-you-need.pdf">https://papers.neurips.cc/paper/7181-attention-is-all-you-need.pdf</a></li></ul><h3 id="transformer--llm-">Transformer / LLM 入门</h3><ul><li><p>Hugging Face LLM Course — How do Transformers work?<br/><a href="https://huggingface.co/learn/llm-course/en/chapter1/4">https://huggingface.co/learn/llm-course/en/chapter1/4</a></p></li><li><p>Hugging Face LLM Course — Transformer Architectures<br/><a href="https://huggingface.co/learn/llm-course/en/chapter1/6">https://huggingface.co/learn/llm-course/en/chapter1/6</a></p></li><li><p>Hugging Face Course — Chapter 1 Summary<br/><a href="https://huggingface.co/docs/course/chapter1/10">https://huggingface.co/docs/course/chapter1/10</a></p></li></ul><h3 id="attention-">Attention 实现细节</h3><ul><li>PyTorch <code>scaled_dot_product_attention</code><br/><a href="https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.scaled_dot_product_attention.html">https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.scaled_dot_product_attention.html</a></li></ul><h3 id="normalization">Normalization</h3><ul><li><p>Layer Normalization<br/><a href="https://arxiv.org/abs/1607.06450">https://arxiv.org/abs/1607.06450</a></p></li><li><p>Batch Normalization<br/><a href="https://proceedings.mlr.press/v37/ioffe15.html">https://proceedings.mlr.press/v37/ioffe15.html</a></p></li></ul><h3 id="position-encoding">Position Encoding</h3><ul><li><p>Self-Attention with Relative Position Representations<br/><a href="https://arxiv.org/abs/1803.02155">https://arxiv.org/abs/1803.02155</a></p></li><li><p>RoFormer: Enhanced Transformer with Rotary Position Embedding<br/><a href="https://arxiv.org/abs/2104.09864">https://arxiv.org/abs/2104.09864</a></p></li><li><p>Train Short, Test Long: Attention with Linear Biases (ALiBi)<br/><a href="https://arxiv.org/abs/2108.12409">https://arxiv.org/abs/2108.12409</a></p></li></ul><h3 id="decoder-only-">Decoder-only 生成与缓存</h3><ul><li><p>Hugging Face Transformers — KV Cache<br/><a href="https://huggingface.co/docs/transformers/v4.44.2/en/kv_cache">https://huggingface.co/docs/transformers/v4.44.2/en/kv_cache</a></p></li><li><p>Hugging Face Transformers — Generation Strategies<br/><a href="https://huggingface.co/docs/transformers/generation_strategies">https://huggingface.co/docs/transformers/generation_strategies</a></p></li></ul></div><p style="text-align:right"><a href="https://hyli.xyz/posts/notes/transformer-fundamentals#comments">看完了？说点什么呢</a></p></div>]]></description><link>https://hyli.xyz/posts/notes/transformer-fundamentals</link><guid isPermaLink="true">https://hyli.xyz/posts/notes/transformer-fundamentals</guid><dc:creator><![CDATA[行雺]]></dc:creator><pubDate>Wed, 01 Apr 2026 15:09:10 GMT</pubDate></item><item><title><![CDATA[LLM Workflow and Deployment Basics]]></title><description><![CDATA[<div><blockquote>该渲染由 Shiro API 生成，可能存在排版问题，最佳体验请前往：<a href="https://hyli.xyz/posts/notes/llm-workflow-and-deployment-basics">https://hyli.xyz/posts/notes/llm-workflow-and-deployment-basics</a></blockquote><div><p><code>linear / relu / sgd -&gt; tokenization -&gt; LLM workflow -&gt; inference / deployment</code></p><h2 id="sgdlinearrelu">SGD、Linear、ReLU</h2><h3 id="">神经网络为什么能工作</h3><p>神经网络本质上不是神秘黑盒，而是很多简单函数的组合。</p><p>最基础的一条链可以写成：</p><p><code>x -&gt; Linear -&gt; ReLU -&gt; Linear -&gt; loss -&gt; backward -&gt; SGD step</code></p><h3 id="linear-">Linear 是什么</h3><p><code>nn.Linear</code> 做的是一个仿射变换。
它会把输入特征映射到新的特征空间。</p><p>例如：</p><ul><li>输入是 <code>in_features</code></li><li>输出是 <code>out_features</code></li></ul><h3 id="">对应代码</h3><pre class="language-python lang-python"><code class="language-python lang-python">import torch
from torch import nn

linear = nn.Linear(4, 2)
x = torch.randn(3, 4)
y = linear(x)

print(&quot;x shape:&quot;, x.shape)
print(&quot;y shape:&quot;, y.shape)
</code></pre>
<h3 id="">需要记住的点</h3><ul><li><code>Linear</code> 层本身有参数</li><li>这些参数通常包括 <code>weight</code> 和 <code>bias</code></li><li>训练时被更新的，就是这些参数</li></ul><h3 id="">为什么只有线性层不够</h3><p>如果一个模型里只有线性层，那么无论叠多少层，整体仍然只是一个线性变换。
这意味着模型表达能力有限，不能表示复杂函数。</p><p>所以，神经网络真正变强的关键，不只是“层数变多”，而是：</p><p><strong>在线性层之间加入非线性。</strong></p><h3 id="relu-">ReLU 是什么</h3><p><code>ReLU(x) = max(0, x)</code></p><p>也就是：</p><ul><li>正数保留</li><li>负数变成 0</li></ul><h3 id="-relu">为什么需要 ReLU</h3><p>ReLU 是非线性激活函数。
加入 ReLU 后，模型就不再只是简单线性变换的堆叠，而可以表达更复杂的函数关系。</p><h3 id="">对应代码</h3><pre class="language-python lang-python"><code class="language-python lang-python">import torch
from torch import nn

relu = nn.ReLU()

x = torch.tensor([[-1.0, 0.5, 2.0]])
y = relu(x)

print(&quot;before relu:&quot;, x)
print(&quot;after relu:&quot;, y)
</code></pre>
<h3 id="sgd-">SGD 是什么</h3><p>SGD（Stochastic Gradient Descent）做的事情是：</p><ol start="1"><li>用当前 batch 计算 loss</li><li>根据 loss 反向传播得到梯度</li><li>按学习率更新参数</li></ol><p>也就是：</p><pre class="language-python lang-python"><code class="language-python lang-python">param = param - lr * grad
</code></pre>
<h3 id="-stochastic">为什么叫 stochastic</h3><p>因为它通常不是每次用整个数据集精确计算梯度，
而是只用当前一个 batch 来近似当前梯度。</p><h3 id="">学习率为什么重要</h3><p><strong>学习率过大：</strong></p><ul><li>参数更新步子太大</li><li>容易在某个范围内震荡</li><li>甚至可能直接发散</li></ul><p><strong>学习率过小：</strong></p><ul><li>loss 下降太慢</li><li>训练时间过长</li><li>可能很久都看不到明显改善</li></ul><h3 id="">需要记住的点</h3><ul><li>梯度决定方向</li><li>学习率决定步长</li></ul><hr/><h2 id="tokenization">Tokenization</h2><h3 id="tokenization-">tokenization 是什么</h3><p>语言模型不能直接处理原始文本。
文本在进入模型之前，必须先被转换成模型能处理的离散单位和数字表示。</p><p>这个过程就是 tokenization。</p><p>最小视角下，tokenizer 做两件事：</p><ol start="1"><li>把文本切成 token</li><li>把 token 转成 token id</li></ol><h3 id="token-">token 是什么</h3><p>token 是模型输入的基本单位。
在现代 LLM 中，token 往往既不是完整单词，也不是单个字符，而更常是 <strong>subword（子词）</strong>。</p><h3 id="">为什么不用纯单词切分</h3><p>如果按完整单词切分：</p><ul><li>词表会非常大</li><li>遇到新词、罕见词时处理很差</li><li>语言泛化能力不够好</li></ul><h3 id="">为什么不用纯字符切分</h3><p>如果按单个字符切分：</p><ul><li>序列会变得很长</li><li>训练和推理成本会变高</li><li>对模型来说不一定是更好的表示方式</li></ul><p>所以现代 tokenizer 通常在两者之间取折中，使用 subword。</p><h3 id="subword-tokenization">subword tokenization</h3><p>需要认识 3 个名字：</p><ul><li>BPE</li><li>WordPiece</li><li>Unigram</li></ul><p>它们的共同目标都是：</p><p><strong>在控制词表大小的同时，尽可能保留有意义的文本片段。</strong></p><h3 id="-cjk-">对 CJK 的处理</h3><p>对于中文、日文、韩文，tokenizer 通常不会简单按空格切分，
而更可能按字符边界、子词规则，或者直接在原始文本上学习切分方式。</p><p>所以：</p><ul><li>中文里常常接近按字或短片段切</li><li>日文和韩文也常结合 subword 方法处理</li><li>同一句 CJK 文本，在不同 tokenizer 下可能切分结果不同</li></ul><h3 id="special-tokens-">special tokens 是什么</h3><p>除了普通文本 token，tokenizer 通常还会管理一些特殊 token，例如：</p><ul><li>BOS</li><li>EOS</li><li>CLS</li><li>SEP</li><li>PAD</li></ul><p>这说明模型输入不只是正文 token，还包含一些控制信息。</p><h3 id="token-">token 数为什么重要</h3><p>token 数会直接影响：</p><ul><li>输入序列长度</li><li>上下文窗口占用</li><li>推理成本</li><li>延迟和吞吐</li><li>系统性能</li></ul><p>所以 tokenizer 不是一个无关紧要的文本前处理步骤，
它实际上是模型系统的一部分。</p><h3 id="">最小例子</h3><pre class="language-python lang-python"><code class="language-python lang-python">from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained(&quot;bert-base-uncased&quot;)

text = &quot;I like machine learning.&quot;
encoded = tokenizer(text)

print(&quot;input_ids:&quot;, encoded[&quot;input_ids&quot;])
print(&quot;tokens:&quot;, tokenizer.convert_ids_to_tokens(encoded[&quot;input_ids&quot;]))
</code></pre>
<hr/><h2 id="llm-">LLM 的最小全景图</h2><h3 id="llm-">LLM 是什么</h3><p>LLM（Large Language Model）是在大量文本数据上训练出来的语言模型。
它可以理解和生成文本，并且在不做任务专门训练的情况下，处理很多语言任务。</p><p>这里要注意：</p><ul><li>不是所有任务都能直接做好</li><li>也不是永远不需要进一步适配</li><li>但相比传统 NLP，LLM 的泛化能力更强</li></ul><h3 id="training--fine-tuning--inference">training / fine-tuning / inference</h3><p><strong>training / pretraining：</strong></p><ul><li>从大量数据中训练模型</li><li>学习通用语言模式</li><li>得到一个基础模型</li></ul><p><strong>fine-tuning：</strong></p><ul><li>在已有预训练模型基础上继续训练</li><li>用更具体的数据做适配</li><li>让模型更适合某个任务、领域或风格</li></ul><p><strong>inference：</strong></p><ul><li>使用现有模型做预测或生成</li><li>不再更新模型参数</li><li>只做前向计算</li></ul><p><strong>deployment / serving：</strong></p><ul><li>把 inference 包装成一个可调用的服务</li><li>对外提供接口或应用</li><li>让模型真正可用</li></ul><h3 id="-llm">为什么“做 LLM”不等于“只看模型结构”</h3><p>做 LLM 不只是看 transformer 结构或者参数量。</p><p>一个真实的 LLM 工作流还包括：</p><ul><li>data</li><li>tokenizer</li><li>model</li><li>training / fine-tuning</li><li>inference</li><li>serving</li><li>工具链与模型管理</li></ul><p>也就是说：</p><p><strong>模型只是系统的一部分，不是全部。</strong></p><h3 id="">最小流程图</h3><pre class="language-text lang-text"><code class="language-text lang-text">data -&gt; tokenizer -&gt; model -&gt; training/fine-tuning -&gt; inference -&gt; serving -&gt; agent
</code></pre>
<hr/><h2 id="deployment-awareness">Deployment Awareness</h2><h3 id="">为什么训练脚本不等于部署</h3><p>训练脚本的职责是：</p><ul><li>加载数据</li><li>计算 loss</li><li>反向传播</li><li>更新参数</li></ul><p>而部署需要的是：</p><ul><li>一个稳定的推理入口</li><li>接受输入</li><li>返回预测结果</li><li>对外提供服务</li></ul><p>所以训练代码和部署代码不是一回事。</p><h3 id="inference-script-">inference script 最小需要什么</h3><p>一个最小推理脚本通常需要：</p><ol start="1"><li>加载模型结构</li><li>加载模型权重</li><li>切到 <code>model.eval()</code></li><li>接受输入</li><li>做前向计算</li><li>返回预测结果</li></ol><p>如果是文本模型，还通常需要：</p><ul><li>加载 tokenizer</li></ul><h3 id="-modeleval-">为什么 <code>model.eval()</code> 在部署里很重要</h3><p>推理阶段一般需要稳定、可复现的输出。
如果不切到 <code>eval()</code>：</p><ul><li>Dropout 可能还在随机丢弃神经元</li><li>BatchNorm 可能还在使用当前 batch 的统计量</li></ul><p>这会导致推理结果不稳定。</p><p>所以部署时通常会写：</p><pre class="language-python lang-python"><code class="language-python lang-python">model.eval()
with torch.no_grad():
    output = model(x)
</code></pre>
<h3 id="-web-demo-">最小 Web demo 的核心抽象</h3><p>最小 Web demo 的核心不是“服务器”，而是：</p><p><code>input -&gt; predict_function -&gt; output</code></p><p>也就是说，本质上你只需要先写一个预测函数，然后再把它包装成界面或接口。</p><h3 id="-gradio-">一个最小 Gradio 例子</h3><pre class="language-python lang-python"><code class="language-python lang-python">import gradio as gr

def predict(text):
    return f&quot;you entered: {text}&quot;

demo = gr.Interface(
    fn=predict,
    inputs=&quot;text&quot;,
    outputs=&quot;text&quot;
)

demo.launch()
</code></pre>
<p>这里最关键的是：</p><ul><li><code>fn</code>：预测函数</li><li><code>inputs</code>：输入类型</li><li><code>outputs</code>：输出类型</li></ul><hr/><h2 id="">最重要的结论</h2><ol start="1"><li><strong>线性层负责做特征映射。</strong></li><li><strong>只有线性层不够，因为整体仍然是线性函数。</strong></li><li><strong>ReLU 这样的非线性激活函数让模型具备更强表达能力。</strong></li><li><strong>SGD 用 batch 的梯度近似来更新参数。</strong></li><li><strong>tokenizer 负责把文本切成 token，并转换成 token id。</strong></li><li><strong>现代模型常使用 subword，而不是纯单词或纯字符。</strong></li><li><strong>token 数会影响上下文长度、推理成本和系统性能。</strong></li><li><strong>LLM 是在大规模文本上训练出来的语言模型。</strong></li><li><strong>training、fine-tuning、inference、deployment 是不同阶段。</strong></li><li><strong>做 LLM 工程不是只看模型结构，而是整条工作流。</strong></li><li><strong>训练代码负责更新参数，推理代码负责接受输入并输出预测。</strong></li><li><strong>最小 Web demo 的核心抽象是：<code>input -&gt; prediction function -&gt; output</code>。</strong></li></ol><hr/><h2 id="">到这里，应该已经能做到</h2><ul><li>理解 <code>Linear</code> 层在做什么</li><li>理解为什么神经网络需要非线性激活函数</li><li>理解 ReLU 的作用</li><li>理解 SGD 为什么能让 loss 下降</li><li>理解学习率对训练速度和稳定性的影响</li><li>理解 token、word、character 的区别</li><li>理解 tokenizer 的最小职责</li><li>知道常见 subword 算法名字</li><li>知道 token 数为什么影响 LLM 系统表现</li><li>理解 LLM 的基本定义和工作流</li><li>区分 training / fine-tuning / inference / deployment</li><li>理解训练脚本和推理脚本的区别</li><li>理解为什么部署前必须 <code>model.eval()</code></li><li>理解最小 Web demo 的抽象方式</li></ul><hr/><h2 id="references">References</h2><h3 id="-llm-">从神经网络基础到 LLM 与部署</h3><ul><li><a href="https://course.fast.ai/Lessons/lesson3.html">fast.ai Lesson 3</a></li><li><a href="https://docs.pytorch.org/docs/stable/generated/torch.nn.Linear.html">PyTorch nn.Linear Documentation</a></li><li><a href="https://docs.pytorch.org/docs/stable/generated/torch.nn.ReLU.html">PyTorch nn.ReLU Documentation</a></li><li><a href="https://docs.pytorch.org/docs/stable/generated/torch.optim.SGD.html">PyTorch SGD Documentation</a></li><li><a href="https://huggingface.co/docs/transformers/tokenizer_summary">Hugging Face Tokenization Algorithms</a></li><li><a href="https://huggingface.co/learn/llm-course/chapter2/4">Hugging Face LLM Course - Tokenizers</a></li><li><a href="https://huggingface.co/learn/llm-course/chapter1/1">Hugging Face LLM Course - Introduction</a></li><li><a href="https://huggingface.co/learn/llm-course/chapter1/2">Hugging Face LLM Course - NLP and LLMs</a></li><li><a href="https://course.fast.ai/Lessons/lesson2.html">fast.ai Lesson 2</a></li><li><a href="https://www.gradio.app/guides/quickstart">Gradio Quickstart</a></li></ul></div><p style="text-align:right"><a href="https://hyli.xyz/posts/notes/llm-workflow-and-deployment-basics#comments">看完了？说点什么呢</a></p></div>]]></description><link>https://hyli.xyz/posts/notes/llm-workflow-and-deployment-basics</link><guid isPermaLink="true">https://hyli.xyz/posts/notes/llm-workflow-and-deployment-basics</guid><dc:creator><![CDATA[行雺]]></dc:creator><pubDate>Wed, 25 Mar 2026 10:46:36 GMT</pubDate></item><item><title><![CDATA[PyTorch DL Basics]]></title><description><![CDATA[<div><blockquote>该渲染由 Shiro API 生成，可能存在排版问题，最佳体验请前往：<a href="https://hyli.xyz/posts/notes/pytorch-dl-basics">https://hyli.xyz/posts/notes/pytorch-dl-basics</a></blockquote><div><p>核心目标不是学会很多 API，而是先把最小训练闭环真正串起来：</p><p><code>dataset -&gt; dataloader -&gt; model -&gt; forward -&gt; loss -&gt; backward -&gt; optimizer.step() -&gt; eval -&gt; save/load</code></p><hr/><h2 id="">最小训练闭环是什么</h2><p>训练一个神经网络，本质上是在重复下面几步：</p><ol start="1"><li>从 <code>dataloader</code> 中取出一个 batch 的数据</li><li>把数据送进 <code>model</code> 做前向计算，得到预测值</li><li>用 <code>loss function</code> 比较预测值和真实标签，得到 <code>loss</code></li><li>对 <code>loss</code> 调用 <code>backward()</code>，计算梯度</li><li>调用 <code>optimizer.step()</code>，根据梯度更新参数</li><li>调用 <code>optimizer.zero_grad()</code>，清空旧梯度</li></ol><h3 id="">需要理解的概念</h3><ul><li><strong>batch</strong>：一次送进模型的一批样本</li><li><strong>step</strong>：处理一个 batch 并更新一次参数</li><li><strong>epoch</strong>：完整遍历整个训练集一次</li><li><strong>loss</strong>：模型当前预测得有多差</li><li><strong>gradient</strong>：loss 对参数的变化率</li><li><strong>learning rate (lr)</strong>：每次更新参数走多大一步</li></ul><h3 id="">为什么参数更新时用减号</h3><p>因为梯度指向的是 <strong>loss 增大的方向</strong>。<br/>训练的目标是让 loss 下降，所以参数更新要沿着 <strong>负梯度方向</strong> 走：</p><pre class="language-python lang-python"><code class="language-python lang-python">w = w - lr * w.grad
</code></pre>
<hr/><h2 id="dataset--dataloader">Dataset 和 DataLoader</h2><h3 id="dataset-">Dataset 是什么</h3><p><code>Dataset</code> 定义的是：<strong>第 i 个样本是什么</strong>。</p><p>它通常负责：</p><ul><li>读取样本</li><li>返回输入和标签</li><li>支持按索引取数据</li></ul><h3 id="dataloader-">DataLoader 是什么</h3><p><code>DataLoader</code> 定义的是：<strong>这些样本怎么一批一批取出来</strong>。</p><p>它通常负责：</p><ul><li>按 batch 组织样本</li><li>是否打乱顺序（<code>shuffle=True/False</code>）</li><li>多进程加载（<code>num_workers</code>）</li></ul><h3 id="">两者关系</h3><ul><li><code>Dataset</code>：单个样本级别</li><li><code>DataLoader</code>：batch 级别</li></ul><h3 id="">对应代码</h3><pre class="language-python lang-python"><code class="language-python lang-python">from torch.utils.data import Dataset, DataLoader
import torch

class ToyDataset(Dataset):
    def __init__(self):
        self.X = torch.tensor([
            [0.0, 0.0],
            [0.0, 1.0],
            [1.0, 0.0],
            [1.0, 1.0],
        ])
        self.y = torch.tensor([0, 1, 1, 0])

    def __len__(self):
        return len(self.X)

    def __getitem__(self, idx):
        return self.X[idx], self.y[idx]

dataset = ToyDataset()
dataloader = DataLoader(dataset, batch_size=2, shuffle=True)

for X, y in dataloader:
    print(&quot;X shape:&quot;, X.shape)
    print(&quot;y shape:&quot;, y.shape)
    break
</code></pre>
<hr/><h2 id="modelforward--autograd">Model、forward 和 autograd</h2><h3 id="nnmodule-"><code>nn.Module</code> 是什么</h3><p>在 PyTorch 中，模型通常继承自 <code>nn.Module</code>。</p><p>一般会在：</p><ul><li><code>__init__()</code> 中定义层</li><li><code>forward()</code> 中定义数据如何流过这些层</li></ul><h3 id="forward-"><code>forward()</code> 是什么</h3><p><code>forward()</code> 描述的是：<strong>输入如何变成输出</strong>。</p><p>例如：</p><ul><li>输入先经过线性层</li><li>再经过激活函数</li><li>最后输出 logits</li></ul><h3 id="autograd-">autograd 是什么</h3><p>PyTorch 在前向计算时会自动构建计算图。
调用 <code>loss.backward()</code> 后，会自动按链式法则计算梯度，并把结果存到参数的 <code>.grad</code> 里。</p><h3 id="">对应代码</h3><pre class="language-python lang-python"><code class="language-python lang-python">import torch
from torch import nn

class SimpleNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(2, 8)
        self.relu = nn.ReLU()
        self.linear2 = nn.Linear(8, 2)

    def forward(self, x):
        x = self.linear1(x)
        x = self.relu(x)
        x = self.linear2(x)
        return x

model = SimpleNet()

X = torch.tensor([[1.0, 0.0]])
logits = model(X)

print(&quot;logits:&quot;, logits)
print(&quot;shape:&quot;, logits.shape)
</code></pre>
<h3 id="-autograd-">最小 autograd 例子</h3><pre class="language-python lang-python"><code class="language-python lang-python">import torch

x = torch.tensor([[1.0, 2.0]])
y = torch.tensor([[1.0]])

w = torch.tensor([[0.5], [-1.0]], requires_grad=True)
b = torch.tensor([0.1], requires_grad=True)

z = x @ w + b
loss = (z - y).pow(2).mean()

print(&quot;loss:&quot;, loss.item())

loss.backward()

print(&quot;w.grad:&quot;, w.grad)
print(&quot;b.grad:&quot;, b.grad)
</code></pre>
<h3 id="">需要记住的点</h3><ul><li><code>requires_grad=True</code> 表示要跟踪梯度</li><li><code>loss.backward()</code> 会把梯度写到参数的 <code>.grad</code> 上</li><li>梯度默认会累积</li></ul><hr/><h2 id="optimizertrainevalcheckpoint">optimizer、train/eval、checkpoint</h2><h3 id="optimizer-">optimizer 是什么</h3><p><code>optimizer</code> 负责根据梯度更新参数。</p><p>例如：</p><pre class="language-python lang-python"><code class="language-python lang-python">optimizer = torch.optim.SGD(model.parameters(), lr=0.1)
</code></pre>
<p>这里：</p><ul><li><code>model.parameters()</code> 表示要训练哪些参数</li><li><code>lr</code> 表示学习率</li></ul><h3 id="train--eval-">train 和 eval 的区别</h3><ul><li><code>model.train()</code>：训练模式</li><li><code>model.eval()</code>：评估/推理模式</li></ul><p>它们本身<strong>不会自动更新参数，也不会自动计算准确率</strong>。
它们的作用是切换某些层的行为，例如：</p><ul><li>Dropout</li><li>BatchNorm</li></ul><h3 id="-eval">为什么推理前要 <code>eval()</code></h3><p>因为如果模型里有 Dropout / BatchNorm，而你没有切到 <code>eval()</code>：</p><ul><li>Dropout 还会随机丢弃神经元</li><li>BatchNorm 还会用当前 batch 的统计量</li></ul><p>这样同一个输入可能得到不稳定的输出。</p><h3 id="checkpoint-">checkpoint 是什么</h3><p>checkpoint 就是把训练好的模型参数保存下来，之后再加载恢复。</p><p>推荐方式是保存 <code>state_dict()</code>。</p><h3 id="-train--test-loop">最小 train / test loop</h3><pre class="language-python lang-python"><code class="language-python lang-python">import torch
from torch import nn
from torch.utils.data import DataLoader, Dataset

class ToyDataset(Dataset):
    def __init__(self):
        self.X = torch.tensor([
            [0.0, 0.0],
            [0.0, 1.0],
            [1.0, 0.0],
            [1.0, 1.0],
        ])
        self.y = torch.tensor([0, 1, 1, 0])

    def __len__(self):
        return len(self.X)

    def __getitem__(self, idx):
        return self.X[idx], self.y[idx]

class SimpleNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(2, 8)
        self.relu = nn.ReLU()
        self.linear2 = nn.Linear(8, 2)

    def forward(self, x):
        return self.linear2(self.relu(self.linear1(x)))

def train_loop(dataloader, model, loss_fn, optimizer):
    model.train()
    for X, y in dataloader:
        pred = model(X)
        loss = loss_fn(pred, y)

        optimizer.zero_grad()
        loss.backward()
        optimizer.step()

    return loss.item()

def test_loop(dataloader, model, loss_fn):
    model.eval()
    total_loss = 0.0
    total_correct = 0
    total_samples = 0

    with torch.no_grad():
        for X, y in dataloader:
            pred = model(X)
            total_loss += loss_fn(pred, y).item()
            total_correct += (pred.argmax(dim=1) == y).sum().item()
            total_samples += y.size(0)

    avg_loss = total_loss / len(dataloader)
    acc = total_correct / total_samples
    return avg_loss, acc

dataset = ToyDataset()
dataloader = DataLoader(dataset, batch_size=2, shuffle=True)

model = SimpleNet()
loss_fn = nn.CrossEntropyLoss()
optimizer = torch.optim.SGD(model.parameters(), lr=0.1)

for epoch in range(10):
    train_loss = train_loop(dataloader, model, loss_fn, optimizer)
    test_loss, test_acc = test_loop(dataloader, model, loss_fn)
    print(f&quot;epoch={epoch+1}, train_loss={train_loss:.4f}, test_loss={test_loss:.4f}, test_acc={test_acc:.2%}&quot;)
</code></pre>
<h3 id="">保存和加载模型</h3><pre class="language-python lang-python"><code class="language-python lang-python">import torch

# save
torch.save(model.state_dict(), &quot;model_weights.pth&quot;)

# load
new_model = SimpleNet()
new_model.load_state_dict(torch.load(&quot;model_weights.pth&quot;, weights_only=True))
new_model.eval()
</code></pre>
<hr/><h2 id="">最重要的结论</h2><ol start="1"><li><p><strong>训练闭环的核心是：</strong>
<code>forward -&gt; loss -&gt; backward -&gt; optimizer.step()</code></p></li><li><p><strong>Dataset 和 DataLoader 的区别是：</strong></p><ul><li>Dataset 负责单个样本</li><li>DataLoader 负责 batch</li></ul></li><li><p><strong>模型通常继承 <code>nn.Module</code>，并在 <code>forward()</code> 中定义前向计算。</strong></p></li><li><p><strong>autograd 会自动求梯度，<code>loss.backward()</code> 后梯度会写到参数的 <code>.grad</code> 上。</strong></p></li><li><p><strong>optimizer 根据梯度更新参数，学习率控制更新步长。</strong></p></li><li><p><strong>推理时要用 <code>model.eval()</code>，并通常配合 <code>torch.no_grad()</code>。</strong></p></li><li><p><strong>推荐保存 <code>state_dict()</code>，加载时先重新创建模型再 <code>load_state_dict()</code>。</strong></p></li></ol><hr/><h2 id="">到这里，应该已经能做到：</h2><ul><li>看懂一个最小 PyTorch 训练脚本</li><li>理解 batch / step / epoch 的关系</li><li>理解 loss、gradient、learning rate 的基本作用</li><li>写出一个最小 <code>nn.Module</code></li><li>写出最小 train/test loop</li><li>保存并加载模型参数</li></ul><hr/><h2 id="references">References</h2><h3 id="">最小训练闭环</h3><ul><li><a href="https://docs.pytorch.org/tutorials/beginner/basics/intro.html">PyTorch Learn the Basics</a></li><li><a href="https://docs.pytorch.org/tutorials/beginner/basics/quickstart_tutorial.html">PyTorch Quickstart</a></li></ul><h3 id="dataset--dataloader">Dataset 和 DataLoader</h3><ul><li><a href="https://docs.pytorch.org/tutorials/beginner/basics/data_tutorial.html">PyTorch Datasets &amp; DataLoaders</a></li><li><a href="https://docs.pytorch.org/docs/stable/data.html">torch.utils.data.DataLoader Documentation</a></li></ul><h3 id="modelforward--autograd">Model、forward 和 autograd</h3><ul><li><a href="https://docs.pytorch.org/tutorials/beginner/basics/buildmodel_tutorial.html">Build the Neural Network</a></li><li><a href="https://docs.pytorch.org/tutorials/beginner/basics/autogradqs_tutorial.html">Automatic Differentiation with torch.autograd</a></li></ul><h3 id="optimizertrainevalcheckpoint">optimizer、train/eval、checkpoint</h3><ul><li><a href="https://docs.pytorch.org/tutorials/beginner/basics/optimization_tutorial.html">Optimizing Model Parameters</a></li><li><a href="https://docs.pytorch.org/tutorials/beginner/basics/saveloadrun_tutorial.html">Save and Load the Model</a></li></ul><h3 id="optional">Optional</h3><ul><li><a href="https://docs.pytorch.org/docs/stable/generated/torch.nn.Module.html">PyTorch nn.Module Documentation</a></li><li><a href="https://docs.pytorch.org/docs/stable/generated/torch.nn.Dropout.html">PyTorch Dropout Documentation</a></li><li><a href="https://docs.pytorch.org/docs/stable/generated/torch.nn.BatchNorm2d.html">PyTorch BatchNorm2d Documentation</a></li></ul></div><p style="text-align:right"><a href="https://hyli.xyz/posts/notes/pytorch-dl-basics#comments">看完了？说点什么呢</a></p></div>]]></description><link>https://hyli.xyz/posts/notes/pytorch-dl-basics</link><guid isPermaLink="true">https://hyli.xyz/posts/notes/pytorch-dl-basics</guid><dc:creator><![CDATA[行雺]]></dc:creator><pubDate>Tue, 24 Mar 2026 10:32:19 GMT</pubDate></item><item><title><![CDATA[Prompt Engineering V7]]></title><description><![CDATA[<link rel="preload" as="image" href="https://s.hyli.xyz/img/2025/12/10/1765358351.png"/><div><blockquote>该渲染由 Shiro API 生成，可能存在排版问题，最佳体验请前往：<a href="https://hyli.xyz/posts/docs/prompt-engineering_v7">https://hyli.xyz/posts/docs/prompt-engineering_v7</a></blockquote><div><h1 id="prompt-engineering">Prompt Engineering</h1><p>Author: Lee Boonstra</p><h2 id="acknowledgements">Acknowledgements</h2><h3 id="content-contributors">Content contributors</h3><ul><li>Michael Sherman</li><li>Yuan Cao</li><li>Erick Armbrust</li><li>Anant Nawalgaria</li><li>Antonio Gulli</li><li>Simone Cammel</li></ul><h3 id="curators-and-editors">Curators and Editors</h3><ul><li>Antonio Gulli</li><li>Anant Nawalgaria</li><li>Grace Mollison</li></ul><h3 id="technical-writer">Technical Writer</h3><ul><li>Joey Haymaker</li></ul><h3 id="designer">Designer</h3><ul><li>Michael Lanning</li></ul><h2 id="table-of-contents">Table of contents</h2><ul><li><a href="#introduction">Introduction</a></li><li><a href="#prompt-engineering">Prompt engineering</a></li><li><a href="#llm-output-configuration">LLM output configuration</a>
<ul><li><a href="#output-length">Output length</a></li><li><a href="#sampling-controls">Sampling controls</a>
<ul><li><a href="#temperature">Temperature</a></li><li><a href="#top-k-and-top-p">Top-K and top-P</a></li><li><a href="#putting-it-all-together">Putting it all together</a></li></ul></li></ul></li><li><a href="#prompting-techniques">Prompting techniques</a>
<ul><li><a href="#general-prompting--zero-shot">General prompting / zero shot</a></li><li><a href="#one-shot--few-shot">One-shot &amp; few-shot</a></li><li><a href="#system-contextual-and-role-prompting">System, contextual and role prompting</a>
<ul><li><a href="#system-prompting">System prompting</a></li><li><a href="#role-prompting">Role prompting</a></li><li><a href="#contextual-prompting">Contextual prompting</a></li></ul></li><li><a href="#step-back-prompting">Step-back prompting</a></li><li><a href="#chain-of-thought-cot">Chain of Thought (CoT)</a></li><li><a href="#self-consistency">Self-consistency</a></li><li><a href="#tree-of-thoughts-tot">Tree of Thoughts (ToT)</a></li><li><a href="#react-reason--act">ReAct (reason &amp; act)</a></li><li><a href="#automatic-prompt-engineering">Automatic Prompt Engineering</a></li><li><a href="#code-prompting">Code prompting</a>
<ul><li><a href="#prompts-for-writing-code">Prompts for writing code</a></li><li><a href="#prompts-for-explaining-code">Prompts for explaining code</a></li><li><a href="#prompts-for-translating-code">Prompts for translating code</a></li><li><a href="#prompts-for-debugging-and-reviewing-code">Prompts for debugging and reviewing code</a></li><li><a href="#what-about-multimodal-prompting">What about multimodal prompting?</a></li></ul></li></ul></li><li><a href="#best-practices">Best Practices</a>
<ul><li><a href="#provide-examples">Provide examples</a></li><li><a href="#design-with-simplicity">Design with simplicity</a></li><li><a href="#be-specific-about-the-output">Be specific about the output</a></li><li><a href="#use-instructions-over-constraints">Use Instructions over Constraints</a></li><li><a href="#control-the-max-token-length">Control the max token length</a></li><li><a href="#use-variables-in-prompts">Use variables in prompts</a></li><li><a href="#experiment-with-input-formats-and-writing-styles">Experiment with input formats and writing styles</a></li><li><a href="#for-few-shot-prompting-with-classification-tasks-mix-up-the-classes">For few-shot prompting with classification tasks, mix up the classes</a></li><li><a href="#adapt-to-model-updates">Adapt to model updates</a></li><li><a href="#experiment-with-output-formats">Experiment with output formats</a></li><li><a href="#json-repair">JSON Repair</a></li><li><a href="#working-with-schemas">Working with Schemas</a></li><li><a href="#experiment-together-with-other-prompt-engineers">Experiment together with other prompt engineers</a></li><li><a href="#cot-best-practices">CoT Best practices</a></li><li><a href="#document-the-various-prompt-attempts">Document the various prompt attempts</a></li></ul></li><li><a href="#summary">Summary</a></li><li><a href="#endnotes">Endnotes</a></li></ul><h2 id="introduction">Introduction</h2><p>You don&#x27;t need to be a data scientist or a machine learning engineer – everyone can write a prompt.</p><p>When thinking about a large language model input and output, a text prompt (sometimes accompanied by other modalities such as image prompts) is the input the model uses to predict a specific output. You don’t need to be a data scientist or a machine learning engineer – everyone can write a prompt. However, crafting the most effective prompt can be complicated. Many aspects of your prompt affect its efficacy: the model you use, the model’s training data, the model configurations, your word-choice, style and tone, structure, and context all matter. Therefore, prompt engineering is an iterative process. Inadequate prompts can lead to ambiguous, inaccurate responses, and can hinder the model’s ability to provide meaningful output.</p><p>When you chat with the Gemini chatbot,$^1$ you basically write prompts, however this whitepaper focuses on writing prompts for the Gemini model within Vertex AI or by using the API, because by prompting the model directly you will have access to the configuration such as temperature etc.</p><p>This whitepaper discusses prompt engineering in detail. We will look into the various prompting techniques to help you getting started and share tips and best practices to become a prompting expert. We will also discuss some of the challenges you can face while crafting prompts.</p><h2 id="prompt-engineering">Prompt engineering</h2><p>Remember how an LLM works; it&#x27;s a prediction engine. The model takes sequential text as an input and then predicts what the following token should be, based on the data it was trained on. The LLM is operationalized to do this over and over again, adding the previously predicted token to the end of the sequential text for predicting the following token. The next token prediction is based on the relationship between what&#x27;s in the previous tokens and what the LLM has seen during its training.</p><p>When you write a prompt, you are attempting to set up the LLM to predict the right sequence of tokens. Prompt engineering is the process of designing high-quality prompts that guide LLMs to produce accurate outputs. This process involves tinkering to find the best prompt, optimizing prompt length, and evaluating a prompt’s writing style and structure in relation to the task. In the context of natural language processing and LLMs, a prompt is an input provided to the model to generate a response or prediction.</p><p>These prompts can be used to achieve various kinds of understanding and generation tasks such as text summarization, information extraction, question and answering, text classification, language or code translation, code generation, and code documentation or reasoning.</p><p>Please feel free to refer to Google&#x27;s prompting guides with simple and effective prompting examples.</p><p>When prompt engineering, you will start by choosing a model. Prompts might need to be optimized for your specific model, regardless of whether you use Gemini language models in Vertex AI, GPT, Claude, or an open source model like Gemma or LLaMA.</p><p>Besides the prompt, you will also need to tinker with the various configurations of a LLM.</p><h2 id="llm-output-configuration">LLM output configuration</h2><p>Once you choose your model you will need to figure out the model configuration. Most LLMs come with various configuration options that control the LLM&#x27;s output. Effective prompt engineering requires setting these configurations optimally for your task.</p><h3 id="output-length">Output length</h3><p>An important configuration setting is the number of tokens to generate in a response. Generating more tokens requires more computation from the LLM, leading to higher energy consumption, potentially slower response times, and higher costs.</p><p>Reducing the output length of the LLM doesn’t cause the LLM to become more stylistically or textually succinct in the output it creates, it just causes the LLM to stop predicting more tokens once the limit is reached. If your needs require a short output length, you’ll also possibly need to engineer your prompt to accommodate.</p><p>Output length restriction is especially important for some LLM prompting techniques, like ReAct, where the LLM will keep emitting useless tokens after the response you want.</p><p>Be aware, generating more tokens requires more computation from the LLM, leading to higher energy consumption and potentially slower response times, which leads to higher costs.</p><h3 id="sampling-controls">Sampling controls</h3><p>LLMs do not formally predict a single token. Rather, LLMs predict probabilities for what the next token could be, with each token in the LLM’s vocabulary getting a probability. Those token probabilities are then sampled to determine what the next produced token will be. Temperature, top-K, and top-P are the most common configuration settings that determine how predicted token probabilities are processed to choose a single output token.</p><h3 id="temperature">Temperature</h3><p>Temperature controls the degree of randomness in token selection. Lower temperatures are good for prompts that expect a more deterministic response, while higher temperatures can lead to more diverse or unexpected results. A temperature of 0 (greedy decoding) is deterministic: the highest probability token is always selected (though note that if two tokens have the same highest predicted probability, depending on how tiebreaking is implemented you may not always get the same output with temperature 0).</p><p>Temperatures close to the max tend to create more random output. And as temperature gets higher and higher, all tokens become equally likely to be the next predicted token.</p><p>The Gemini temperature control can be understood in a similar way to the softmax function used in machine learning. A low temperature setting mirrors a low softmax temperature (T), emphasizing a single, preferred temperature with high certainty. A higher Gemini temperature setting is like a high softmax temperature, making a wider range of temperatures around the selected setting more acceptable. This increased uncertainty accommodates scenarios where a rigid, precise temperature may not be essential like for example when experimenting with creative outputs.</p><h3 id="top-k-and-top-p">Top-K and top-P</h3><p>Top-K and top-P (also known as nucleus sampling)$^4$ are two sampling settings used in LLMs to restrict the predicted next token to come from tokens with the top predicted probabilities. Like temperature, these sampling settings control the randomness and diversity of generated text.</p><ul><li><p>Top-K sampling selects the top K most likely tokens from the model’s predicted distribution. The higher top-K, the more creative and varied the model’s output; the lower top-K, the more restive and factual the model’s output. A top-K of 1 is equivalent to greedy decoding.</p></li><li><p>Top-P sampling selects the top tokens whose cumulative probability does not exceed a certain value (P). Values for P range from 0 (greedy decoding) to 1 (all tokens in the LLM&#x27;s vocabulary).</p></li></ul><p>The best way to choose between top-K and top-P is to experiment with both methods (or both together) and see which one produces the results you are looking for.</p><h3 id="putting-it-all-together">Putting it all together</h3><p>Choosing between top-K, top-P, temperature, and the number of tokens to generate, depends on the specific application and desired outcome, and the settings all impact one another. It’s also important to make sure you understand how your chosen model combines the different sampling settings together.</p><p>If temperature, top-K, and top-P are all available (as in Vertex Studio), tokens that meet both the top-K and top-P criteria are candidates for the next predicted token, and then temperature is applied to sample from the tokens that passed the top-K and top-P criteria. If only top-K or top-P is available, the behavior is the same but only the one top-K or P setting is used.</p><p>If temperature is not available, whatever tokens meet the top-K and/or top-P criteria are then randomly selected from to produce a single next predicted token.</p><p>At extreme settings of one sampling configuration value, that one sampling setting either cancels out other configuration settings or becomes irrelevant.</p><ul><li><p>If you set temperature to 0, top-K and top-P become irrelevant—the most probable token becomes the next token predicted. If you set temperature extremely high (above 1—generally into the 10s), temperature becomes irrelevant and whatever tokens make it through the top-K and/or top-P criteria are then randomly sampled to choose a next predicted token.</p></li><li><p>If you set top-K to 1, temperature and top-P become irrelevant. Only one token passes the top-K criteria, and that token is the next predicted token. If you set top-K extremely high, like to the size of the LLM&#x27;s vocabulary, any token with a nonzero probability of being the next token will meet the top-K criteria and none are selected out.</p></li><li><p>If you set top-P to 0 (or a very small value), most LLM sampling implementations will then only consider the most probable token to meet the top-P criteria, making temperature and top-K irrelevant. If you set top-P to 1, any token with a nonzero probability of being the next token will meet the top-P criteria, and none are selected out.</p></li></ul><p>As a general starting point, a temperature of .2, top-P of .95, and top-K of 30 will give you relatively coherent results that can be creative but not excessively so. If you want especially creative results, try starting with a temperature of .9, top-P of .99, and top-K of 40. And if you want less creative results, try starting with a temperature of .1, top-P of .9, and top-K of 20. Finally, if your task always has a single correct answer (e.g., answering a math problem), start with a temperature of 0.</p><p><strong>NOTE:</strong> With more freedom (higher temperature, top-K, top-P, and output tokens), the LLM might generate text that is less relevant.</p><p><strong>WARNING:</strong> Have you ever seen a response ending with a large amount of filler words? This is also known as the &quot;repetition loop bug&quot;, which is a common issue in Large Language Models where the model gets stuck in a cycle, repeatedly generating the same (filler) word, phrase, or sentence structure, often exacerbated by inappropriate temperature and top-k/top-p settings. This can occur at both low and high temperature settings, though for different reasons. At low temperatures, the model becomes overly deterministic, sticking rigidly to the highest probability path, which can lead to a loop if that path revisits previously generated text. Conversely, at high temperatures, the model&#x27;s output becomes excessively random, increasing the probability that a randomly chosen word or phrase will, by chance, lead back to a prior state, creating a loop due to the vast number of available options. In both cases, the model&#x27;s sampling process gets &quot;stuck,&quot; resulting in monotonous and unhelpful output until the output window is filled. Solving this often requires careful tinkering with temperature and top-k/top-p values to find the optimal balance between determinism and randomness.</p><h2 id="prompting-techniques">Prompting techniques</h2><p>LLMs are tuned to follow instructions and are trained on large amounts of data so they can understand a prompt and generate an answer. But LLMs aren’t perfect; the clearer your prompt text, the better it is for the LLM to predict the next likely text. Additionally, specific techniques that take advantage of how LLMs are trained and how LLMs work will help you get the relevant results from LLMs</p><p>Now that we understand what prompt engineering is and what it takes, let&#x27;s dive into some examples of the most important prompting techniques.</p><h3 id="general-prompting--zero-shot">General prompting / zero shot</h3><p>A zero-shot prompt is the simplest type of prompt. It only provides a description of a task and some text for the LLM to get started with. This input could be anything: a question, a start of a story, or instructions. The name zero-shot stands for ‘no examples’.</p><p>Let&#x27;s use Vertex AI Studio (for Language) in Vertex AI, which provides a playground to test prompts. In Table 1, you will see an example zero-shot prompt to classify movie reviews.</p><p>The table format as used below is a great way of documenting prompts. Your prompts will likely go through many iterations before they end up in a codebase, so it’s important to keep track of your prompt engineering work in a disciplined, structured way. More on this table format, the importance of tracking prompt engineering work, and the prompt development process is in the Best Practices section later in this chapter (“Document the various prompt attempts”).</p><p>The model temperature should be set to a low number, since no creativity is needed, and we use the gemini-pro default top-K and top-P values, which effectively disable both settings (see ‘LLM Output Configuration’ above). Pay attention to the generated output. The words disturbing and masterpiece should make the prediction a little more complicated, as both words are used in the same sentence.</p><table><thead><tr><th> Name        </th><th> 1<em>1</em>movie_classification </th></tr></thead><tbody><tr><td> Goal        </td><td> Classify movie reviews as positive, neutral or negative. </td></tr><tr><td> Model       </td><td> gemini-pro               </td></tr><tr><td> Temperature </td><td> 0.1                      </td></tr><tr><td> Token Limit </td><td> 5 </td></tr><tr><td> Top-K       </td><td> N/A                      </td></tr><tr><td> Top-P       </td><td> 1 </td></tr><tr><td> Prompt      </td><td> Classify movie reviews as POSITIVE, NEUTRAL or NEGATIVE. Review: &quot;Her&quot; is a disturbing study revealing the direction humanity is headed if AI is allowed to keep evolving, unchecked. I wish there were more movies like this masterpiece. Sentiment: </td></tr><tr><td> Output      </td><td> POSITIVE                 </td></tr></tbody></table><p><em>Table 1. An example of zero-shot prompting</em></p><p>When zero-shot doesn&#x27;t work, you can provide demonstrations or examples in the prompt, which leads to &quot;one-shot&quot; and &quot;few-shot&quot; prompting. General prompting / zero shot</p><h4 id="one-shot--few-shot">One-shot &amp; few-shot</h4><p>When creating prompts for AI models, it is helpful to provide examples. These examples can help the model understand what you are asking for. Examples are especially useful when you want to steer the model to a certain output structure or pattern.</p><p>A <strong>one-shot prompt</strong>, provides a single example, hence the name one-shot. The idea is the model has an example it can imitate to best complete the task.</p><p>A <strong>few-shot prompt</strong> provides <em>multiple</em> examples to the model. This approach shows the model a pattern that it needs to follow. The idea is similar to one-shot, but multiple examples of the desired pattern increases the chance the model follows the pattern.</p><p>The number of examples you need for few-shot prompting depends on a few factors, including the complexity of the task, the quality of the examples, and the capabilities of the generative AI (gen AI) model you are using. As a general rule of thumb, you should use at least three to five examples for few-shot prompting. However, you may need to use more examples for more complex tasks, or you may need to use fewer due to the input length limitation of your model.</p><p>Table 2 shows a few-shot prompt example, let&#x27;s use the same gemini-pro model configuration settings as before, other than increasing the token limit to accommodate the need for a longer response.</p><table><thead><tr><th> Goal       </th><th> Parse pizza orders to JSON </th></tr></thead><tbody><tr><td> Model      </td><td> gemini-pro                 </td></tr><tr><td> Temperature</td><td> 0.1                        </td></tr><tr><td> Token Limit </td><td> 250 </td></tr><tr><td> Top-K      </td><td> N/A                        </td></tr><tr><td> Top-P       </td><td> 1   </td></tr><tr><td> Prompt     </td><td> Parse a customer&#x27;s pizza order into valid JSON:<br/><br/>EXAMPLE:<br/>I want a small pizza with cheese, tomato sauce, and pepperoni.<br/>JSON Response:<br/><code>&lt;br&gt;{&lt;br&gt;  &quot;size&quot;: &quot;small&quot;,&lt;br&gt;  &quot;type&quot;: &quot;normal&quot;,&lt;br&gt;  &quot;ingredients&quot;: [[&quot;cheese&quot;, &quot;tomato sauce&quot;, &quot;peperoni&quot;]]&lt;br&gt;}&lt;br&gt;</code><br/><br/>EXAMPLE: Can I get a large pizza with tomato sauce, basil and mozzarella { &quot;size&quot;: &quot;large&quot;, &quot;type&quot;: &quot;normal&quot;, &quot;ingredients&quot;: [[&quot;tomato sauce&quot;, &quot;bazel&quot;, &quot;mozzarella&quot;]] } Now, I would like a large pizza, with the first half cheese and mozzarella. And the other tomato sauce, ham and pineapple. JSON Response: </td></tr><tr><td> Output </td><td> <code> { &quot;size&quot;: &quot;large&quot;, &quot;type&quot;: &quot;half-half&quot;, &quot;ingredients&quot;: [[&quot;cheese&quot;, &quot;mozzarella&quot;], [&quot;tomato sauce&quot;, &quot;ham&quot;, &quot;pineapple&quot;]] } </code> </td></tr></tbody></table><p><em>Table 2. An example of few-shot prompting</em></p><p>When you choose examples for your prompt, use examples that are relevant to the task you want to perform. The examples should be diverse, of high quality, and well written. One small mistake can confuse the model and will result in undesired output.</p><p>If you are trying to generate output that is robust to a variety of inputs, then it is important to include edge cases in your examples. Edge cases are inputs that are unusual or unexpected, but that the model should still be able to handle.</p><h3 id="system-contextual-and-role-prompting">System, contextual and role prompting</h3><p>System, contextual and role prompting are all techniques used to guide how LLMs generate text, but they focus on different aspects:</p><ul><li><p><strong>System prompting</strong> sets the overall context and purpose for the language model. It defines the ‘big picture’ of what the model should be doing, like translating a language, classifying a review etc.</p></li><li><p><strong>Contextual prompting</strong> provides specific details or background information relevant to the current conversation or task. It helps the model to understand the nuances of what’s being asked and tailor the response accordingly.</p></li><li><p><strong>Role prompting</strong> assigns a specific character or identity for the language model to adopt. This helps the model generate responses that are consistent with the assigned role and its associated knowledge and behavior.</p></li></ul><p>There can be considerable overlap between system, contextual, and role prompting. E.g. a prompt that assigns a role to the system, can also have a context.</p><p>However, each type of prompt serves a slightly different primary purpose:</p><ul><li><p>System prompt: Defines the model&#x27;s fundamental capabilities and overarching purpose.</p></li><li><p>Contextual prompt: Provides immediate, task-specific information to guide the response. It’s highly specific to the current task or input, which is dynamic.</p></li><li><p>Role prompt: Frames the model&#x27;s output style and voice. It adds a layer of specificity and personality.</p></li></ul><p>Distinguishing between system, contextual, and role prompts provides a framework for designing prompts with clear intent, allowing for flexible combinations and making it easier to analyze how each prompt type influences the language model&#x27;s output.</p><p>Let&#x27;s dive into these three different kinds of prompts.</p><h4 id="system-prompting">System prompting</h4><p>Table 3 contains a system prompt, where I specify additional information on how to return the output. I increased the temperature to get a higher creativity level, and I specified a higher token limit. However, because of my clear instruction on how to return the output the model didn&#x27;t return extra text.</p><table><thead><tr><th> Goal </th><th> Classify movie reviews as positive, neutral or negative. </th></tr></thead><tbody><tr><td> Model </td><td> gemini-pro </td></tr><tr><td> Temperature </td><td> 1 </td></tr><tr><td> Token Limit </td><td> 5 </td></tr><tr><td> Top-K </td><td> 40 </td></tr><tr><td> Top-P </td><td> 0.8 </td></tr><tr><td> Prompt </td><td> Classify movie reviews as positive, neutral or negative. Only return the label in uppercase.<br/>Review: &quot;Her&quot; is a disturbing study revealing the direction humanity is headed if AI is allowed to keep evolving, unchecked. It&#x27;s so disturbing I couldn&#x27;t watch it.<br/>Sentiment: </td></tr><tr><td> Output </td><td> NEGATIVE </td></tr></tbody></table><p><em>Table 3. An example of system prompting</em></p><p>System prompts can be useful for generating output that meets specific requirements. The name ‘system prompt’ actually stands for ‘providing an additional task to the system’. For example, you could use a system prompt to generate a code snippet that is compatible with a specific programming language, or you could use a system prompt to return a certain structure. Have a look into Table 4, where I return the output in JSON format.</p><table><thead><tr><th> Goal </th><th> Classify movie reviews as positive, neutral or negative, return JSON. </th></tr></thead><tbody><tr><td> Model </td><td> gemini-pro </td></tr><tr><td> Temperature </td><td> 1 </td></tr><tr><td> Token Limit </td><td> 1024 </td></tr><tr><td> Top-K </td><td> 40 </td></tr><tr><td> Top-P </td><td> 0.8 </td></tr><tr><td> Prompt </td><td> Classify movie reviews as positive, neutral or negative. Return valid JSON:<br/><br/>Review: &quot;Her&quot; is a disturbing study revealing the direction humanity is headed if AI is allowed to keep evolving, unchecked. It&#x27;s so disturbing I couldn&#x27;t watch it.<br/><br/>Schema:<br/>...<br/>MOVIE:<br/>{<br/>&quot;sentiment&quot;: String &quot;POSITIVE&quot; | &quot;NEGATIVE&quot; | &quot;NEUTRAL&quot;,<br/>&quot;name&quot;: String<br/>}<br/>MOVIE REVIEWS:<br/>{<br/>&quot;movie_reviews&quot;: [MOVIE]<br/>}<br/>...<br/>JSON Response: </td></tr><tr><td> Output </td><td> ...<br/>{<br/>&quot;movie_reviews&quot;: [<br/>{<br/>&quot;sentiment&quot;: &quot;NEGATIVE&quot;,<br/>&quot;name&quot;: &quot;Her&quot;<br/>}<br/>]<br/>}<br/>... </td></tr></tbody></table><p><em>Table 4. An example of system prompting with JSON format</em></p><p>There are some benefits in returning JSON objects from a prompt that extracts data. In a real-world application I don&#x27;t need to manually create this JSON format, I can already return the data in a sorted order (very handy when working with datetime objects), but most importantly, by prompting for a JSON format it forces the model to create a structure and limit hallucinations.</p><p>System prompts can also be really useful for safety and toxicity. To control the output, simply add an additional line to your prompt like: ‘You should be respectful in your answer.’</p><h4 id="role-prompting">Role prompting</h4><p>Role prompting is a technique in prompt engineering that involves assigning a specific role to the gen AI model. This can help the model to generate more relevant and informative output, as the model can craft its responses to the specific role that it has been assigned.</p><p>For example, you could role prompt a gen AI model to be a book editor, a kindergarten teacher, or a motivational speaker. Once the model has been assigned a role, you can then give it prompts that are specific to that role. For example, you could prompt a teacher to create a lesson plan that they can then review. Have a look into Table 5, where the model takes the role of a travel guide.</p><table><thead><tr><th> Goal </th><th> Act as travel guide and provide 3 travel suggestions </th></tr></thead><tbody><tr><td> Model </td><td> gemini-pro </td></tr><tr><td> Temperature </td><td> 1 </td></tr><tr><td> Token Limit </td><td> 1024 </td></tr><tr><td> Top-K </td><td> 40 </td></tr><tr><td> Top-P </td><td> 0.8 </td></tr><tr><td> Prompt </td><td> I want you to act as a travel guide. I will write to you about my location and you will suggest 3 places to visit near me. In some cases, I will also give you the type of places I will visit.<br/>My suggestion: &quot;I am in Amsterdam and I want to visit only museums.&quot;<br/>Travel Suggestions: </td></tr><tr><td> Output </td><td> 1. Rijksmuseum: World-renowned museum, known for Dutch masterpieces like Rembrandt’s “The Night Watch.” Don’t miss the incredible collection of paintings and artifacts showcasing Dutch art and history.<br/><br/>2. Van Gogh Museum: Immerse yourself in the captivating works of Vincent van Gogh. The museum houses the largest collection of his paintings and drawings, including “The Starry Night” and “Sunflowers.”<br/><br/>3. Stedelijk Museum Amsterdam: Discover modern and contemporary art from around the world. The museum’s collection includes works by Picasso, Kandinsky, and Rietveld, housed in a striking modern building. </td></tr></tbody></table><p><em>Table 5. An example of role prompting</em></p><p>The above example shows an example of taking the role of a travel agent. When you would change the role to a teacher of geography, you would notice that you will receive a different response.</p><p>Defining a role perspective for an AI model gives it a blueprint of the tone, style, and focused expertise you’re looking for to improve the quality, relevance, and effectiveness of your output.</p><p>Here are some styles you can choose from which I find effective:</p><p>Confrontational, Descriptive, Direct, Formal, Humorous, Influential, Informal, Inspirational, Persuasive</p><p>Let&#x27;s change our prompt in Table 6 to include a humorous and inspirational style.</p><table><thead><tr><th> Prompt </th><th> I want you to act as a travel guide. I will write to you about my location and you will suggest 3 places to visit near me in a humorous style.<br/><br/>My suggestion: &quot;I am in Manhattan.&quot;<br/><br/>Travel Suggestions: </th></tr></thead><tbody><tr><td> Output </td><td> 1. Behold the Empire State of Mind: Ascend to the dizzying heights of the Empire State Building and bask in the glory of Manhattan&#x27;s skyline. Prepare to feel like King Kong atop the Big Apple, minus the giant ape-sized banana.<br/><br/>2. Get Artsy-Fartsy at MoMA: Unleash your inner art aficionado at the Museum of Modern Art (MoMA). Gaze upon masterpieces that will boggle your mind and make you question whether your stick-figure drawings have any artistic merit.<br/><br/>3. Shop ‘Til You Drop on Fifth Avenue: Indulge in some retail therapy on the iconic Fifth Avenue. Brace yourself for sticker shock as you window-shop (or actually shop) at designer boutiques that will make your wallet cry. But hey, you’re in Manhattan, so you might as well embrace the fabulousness! </td></tr></tbody></table><p><em>Table 6. An example of role prompting with a humorous tone and style</em></p><h2 id="contextual-prompting">Contextual prompting</h2><p>By providing contextual prompts, you can help ensure that your AI interactions are as seamless and efficient as possible. The model will be able to more quickly understand your request and be able to generate more accurate and relevant responses, as you can see in the example of Table 7.</p><table><thead><tr><th> Goal </th><th> Suggest articles for a blog about retro games </th></tr></thead><tbody><tr><td> Model </td><td> gemini-pro </td></tr><tr><td> Temperature </td><td> 1 </td></tr><tr><td> Token Limit </td><td> 1024 </td></tr><tr><td> Top-K </td><td> 40 </td></tr><tr><td> Top-P </td><td> 0.8 </td></tr><tr><td> Prompt </td><td> Context: You are writing for a blog about retro 80&#x27;s arcade video games.<br/>Suggest 3 topics to write an article about with a few lines of description of what this article should contain. </td></tr><tr><td> Output </td><td> 1. <strong>The Evolution of Arcade Cabinet Design:</strong><br/>This article would explore the evolution of arcade cabinet designs, from the early wood and metal cabinets of the 1970s to the sleek, neon-lit designs of the 1980s and beyond.<br/><br/>2. <strong>Blast From The Past: Iconic Arcade Games of The 80&#x27;s:</strong><br/>- This article would feature a glimpse into the history, impact, and legacy of some of the most iconic and influential arcade games of the 1980s, highlighting their innovations, popular mechanics, and enduring charm.<br/><br/>3. <strong>The Rise and Retro Revival of Pixel Art:</strong><br/>- This article would delve into the evolution of pixel art as a defining visual style of early arcade games, tracing its roots, exploring its techniques, and discussing the resurgence of pixel art in modern games and digital art. </td></tr></tbody></table><p><em>Table 7. An example of contextual prompting</em></p><h3 id="step-back-prompting">Step-back prompting</h3><p>Step-back prompting is a technique for improving the performance by prompting the LLM to first consider a general question related to the specific task at hand, and then feeding the answer to that general question into a subsequent prompt for the specific task. This ‘step back’ allows the LLM to activate relevant background knowledge and reasoning processes before attempting to solve the specific problem.</p><p>By considering the broader and underlying principles, LLMs can generate more accurate and insightful responses. Step-back prompting encourages LLMs to think critically and apply their knowledge in new and creative ways. It changes the final prompt doing the task by utilizing more knowledge in the LLM&#x27;s parameters than would otherwise come into play when the LLM is prompted directly.</p><p>It can help to mitigate biases in LLM responses, by focusing on general principles instead of specific details, step-back prompting.</p><p>Let&#x27;s have a look into these examples to understand how step-back prompting can improve the results. Let&#x27;s first review a traditional prompt (Table 8) before we compare it to a step back prompt (Table 9):</p><table><thead><tr><th> Goal </th><th> Write a storyline for a level of a first-person shooter video game. </th></tr></thead><tbody><tr><td> Model </td><td> gemini-pro </td></tr><tr><td> Temperature </td><td> 1 </td></tr><tr><td> Token Limit </td><td> 1024 </td></tr><tr><td> Top-K </td><td> 40 </td></tr><tr><td> Top-P </td><td> 0.8 </td></tr><tr><td> Prompt </td><td> Write a one paragraph storyline for a new level of a first-person shooter video game that is challenging and engaging. </td></tr><tr><td> Output </td><td> The level begins with the player’s squad being ambushed in a dense urban area by a relentless enemy faction. Players must fight their way through a maze of back alleys and dilapidated buildings, utilizing stealth and precision to eliminate enemy forces and avoid detection. The player must use their environment to their advantage, setting traps, utilizing cover, and making calculated moves to survive. Along the way, they uncover intel suggesting the enemy is planning a devastating attack, and the player must race against time to gather evidence and relay it back to their headquarters before the enemy can carry out their plans. </td></tr></tbody></table><p><em>Table 8. A traditional prompt before we compare it with a step back prompt</em></p><p>When you set the temperature to 1, you might end up with all kinds of creative writings for a storyline, but it’s also quite random and generic. So let’s take a step back:</p><table><thead><tr><th> Prompt </th><th> Based on popular first-person shooter action games, what are 5 fictional key settings that contribute to a challenging and engaging level storyline in a first-person shooter video game? </th></tr></thead><tbody><tr><td> Output </td><td> 1. <strong>Abandoned Military Base</strong>: A sprawling, post-apocalyptic military complex crawling with mutated soldiers and rogue robots, ideal for challenging firearm combat.<br/><br/>2. <strong>Cyberpunk City</strong>: A neon-lit, futuristic urban environment with towering skyscrapers and dense alleyways, featuring cybernetically enhanced enemies and hacking mechanics.<br/><br/>3. <strong>Alien Spaceship</strong>: A vast alien vessel stranded on Earth, with eerie corridors, zero-gravity sections, and extraterrestrial creatures to encounter.<br/><br/>4. <strong>Zombie-Infested Town</strong>: A desolate town overrun by hordes of aggressive zombies, featuring intense close-quarters combat and puzzle-solving to find safe passage.<br/><br/>5. <strong>Underwater Research Facility</strong>: A deep-sea laboratory flooded with water, filled with mutated aquatic creatures, and requiring stealth and underwater exploration skills to survive. </td></tr></tbody></table><p><em>Table 9. An example of prompting for self consistency</em></p><p>Yeah those topics seem like a good fit for a first-person video game. Let&#x27;s go back to the original prompt, but this time we include the answer of the step back as context and see what it will return.</p><table><thead><tr><th style="text-align:left"> Prompt </th><th style="text-align:left"> Context: 5 engaging themes for a first person shooter video game:<br/><br/>1. <strong>Abandoned Military Base</strong>: A sprawling, post-apocalyptic military complex crawling with mutated soldiers and rogue robots, ideal for challenging firearm combat.<br/><br/>2. <strong>Cyberpunk City</strong>: A neon-lit, futuristic urban environment with towering skyscrapers and dense alleyways, featuring cybernetically enhanced enemies and hacking mechanics.<br/><br/>3. <strong>Alien Spaceship</strong>: A vast alien vessel stranded on Earth, with eerie corridors, zero-gravity sections, and extraterrestrial creatures to encounter.<br/><br/>4. <strong>Zombie-Infested Town</strong>: A desolate town overrun by hordes of aggressive zombies, featuring intense close-quarters combat and puzzle-solving to find safe passage.<br/><br/>5. <strong>Underwater Research Facility</strong>: A deep-sea laboratory flooded with water, filled with mutated aquatic creatures, and requiring stealth and underwater exploration skills to survive.<br/><br/>Take one of the themes and write a one paragraph storyline for a new level of a first-person shooter video game that is challenging and engaging. </th></tr></thead><tbody><tr><td style="text-align:left"> Output </td><td style="text-align:left"> In the heart of a murky abyss, lies a dilapidated underwater research facility, standing as a testament to human ambition and its disastrous consequences. Shrouded in darkness, pulsating with the hum of malfunctioning machinery, and haunted by the echoes of drowned souls, the facility is now a breeding ground for a nightmare borne from the deep sea. The player, an elite marine equipped with advanced diving gear and experimental weaponry, is tasked with venturing into this aquatic realm of terror. Armed with resilience and resourcefulness, they must navigate treacherous corridors, solve cryptic puzzles, and confront gruesome sea monstrosities that lurk in the depths. From grappling with the crushing pressure of the deep sea to outsmarting cunning aquatic predators, every moment in this uncharted underworld tests the limits of human endurance and courage. </td></tr></tbody></table><p><em>Table 10. An example of prompting for self consistency</em></p><p>That looks like an interesting video game! By using step back prompting techniques you can increase the accuracy of your prompts.</p><h3 id="chain-of-thought-cot">Chain of Thought (CoT)</h3><p>Chain of Thought (CoT) prompting is a technique for improving the reasoning capabilities of LLMs by generating <em>intermediate reasoning steps</em>. This helps the LLM generate more accurate answers. You can combine it with few-shot prompting to get better results on more complex tasks that require reasoning before responding as it&#x27;s a challenge with a zero-shot chain of thought.</p><p>CoT has a lot of advantages. First of all, it&#x27;s low-effort while being very effective and works well with off-the-shelf LLMs (so no need to finetune). You also get interpretability with CoT prompting, as you can learn from the LLM&#x27;s responses and see the reasoning steps that were followed. If there&#x27;s a malfunction, you will be able to identify it. Chain of thought appears to improve robustness when moving between different LLM versions. Which means the performance of your prompt should drift less between different LLMs than if your prompt does not use reasoning chains. Of course there are also disadvantages, but they are somewhat intuitive.</p><p>The LLM response includes the chain of thought reasoning, which means more output tokens, which means predictions cost more money and take longer.</p><p>To explain the following example in Table 11, let&#x27;s first try to create a prompt that is not using CoT prompting to showcase the flaws of a large language model.</p><table><thead><tr><th style="text-align:left"> Prompt </th><th style="text-align:left"> When I was 3 years old, my partner was 3 times my age. Now, I am 20 years old. How old is my partner? </th></tr></thead><tbody><tr><td style="text-align:left"> Output </td><td style="text-align:left"> 63 years old </td></tr></tbody></table><p><em>Table 11. An example of a prompt which is trying to solve a mathematical problem</em></p><p>Yikes. That’s obviously the wrong answer. As a matter of fact, LLMs often struggle with mathematical tasks and can provide incorrect answers – even for a task as simple as multiplying two numbers. This is because they are trained on large volumes of text and math may require a different approach. So let’s see if intermediate reasoning steps will improve the output.</p><table><thead><tr><th> Prompt </th><th> When I was 3 years old, my partner was 3 times my age. Now, I am 20 years old. How old is my partner? Let&#x27;s think step by step. </th></tr></thead><tbody><tr><td> Output </td><td> 1. Let’s assume my current age is “x” years.<br/>2. When I was 3 years old, my age was 3 years.<br/>3. My partner’s age at that time was 3 times my age, which means my partner’s age was 3 * 3 = 9 years.<br/>4. Now, I am 20 years old, which means my age has increased by 20 - 3 = 17 years since I was 3 years old.<br/>5. Since my partner’s age was 9 years when I was 3 years old, and my age has increased by 17 years, my partner’s age must have also increased by 17 years.<br/>6. Therefore, my partner’s current age is 9 + 17 = 26 years.<br/><br/>So, my partner is 26 years old. </td></tr></tbody></table><p><em>Table 12. An example of Chain of Thought prompting</em></p><p>Alright, now the final answer is correct. That’s because we clearly instructed the LLM to explain each step instead of just returning an answer. It’s interesting to see that the model adds up the 17 increased years. In my head I would take the difference of years between my partner and me and add those up. (20+(9-3)). Let’s help the model to think a little bit more like me.</p><p>Table 12 is an example of &#x27;zero-shot&#x27; Chain of thought. Chain of thought prompting can be very powerful when combined with a single-shot or few-shot, as what you can see in Table 13:</p><table><thead><tr><th> Prompt </th><th> Q: When my brother was 2 years old, I was double his age. Now I am 40 years old. How old is my brother? Let&#x27;s think step by step. A: When my brother was 2 years old, I was 2 * 2 = 4 years old. That&#x27;s an age difference of 2 years and I am older. Now I am 40 years old, so my brother is 40 - 2 = 38 years old. The answer is 38. Q: When I was 3 years old, my partner was 3 times my age. Now, I am 20 years old. How old is my partner? Let&#x27;s think step by step. A: </th></tr></thead><tbody><tr><td> Output </td><td> When I was 3 years old, my partner was 3 * 3 = 9 years old. That’s an age difference of 6 years and my partner is older. Now I am 20 years old, so my partner is 20 + 6 = 26 years old. The answer is 26. </td></tr></tbody></table><p><em>Table 13. An example of chain of thought prompting with a single-shot</em></p><p>Chain of thought can be useful for various use-cases. Think of code generation, for breaking down the request into a few steps, and mapping those to specific lines of code. Or for creating synthetic data when you have some kind of seed like “The product is called XYZ, write a description guiding the model through the assumptions you would make based on the product given title.” Generally, any task that can be solved by ‘talking through is a good candidate for a chain of thought. If you can explain the steps to solve the problem, try chain of thought.</p><p>Please refer to the notebook hosted in the GoogleCloudPlatform Github repository which will go into further detail on CoT prompting:</p><p>In the best practices section of this chapter, we will learn some best practices specific to Chain of thought prompting.</p><h3 id="self-consistency">Self-consistency</h3><p>While large language models have shown impressive success in various NLP tasks, their ability to reason is often seen as a limitation that cannot be overcome solely by increasing model size. As we learned in the previous Chain of Thought prompting section, the model can be prompted to generate reasoning steps like a human solving a problem. However CoT uses a simple ‘greedy decoding’ strategy, limiting its effectiveness. Self-consistency combines sampling and majority voting to generate diverse reasoning paths and select the most consistent answer. It improves the accuracy and coherence of responses generated by LLMs.</p><p>Self-consistency gives a pseudo-probability likelihood of an answer being correct, but obviously has high costs.</p><p>It follows the following steps:</p><ol start="1"><li><p>Generating diverse reasoning paths: The LLM is provided with the same prompt multiple times. A high temperature setting encourages the model to generate different reasoning paths and perspectives on the problem.</p></li><li><p>Extract the answer from each generated response.</p></li><li><p>Choose the most common answer.</p></li></ol><p>Let&#x27;s look into an example of an email classification system, which classifies an email as IMPORTANT or NOT IMPORTANT. A zero-shot chain of thought prompt will be sent to the LLM multiple times, to see if the responses differ after each submit. Notice the friendly tone, the word choice and the sarcasm that&#x27;s been used in the email. All this could trick the LLM.</p><table><thead><tr><th> Prompt </th><th> EMAIL:<br/><code>&lt;br&gt;Hi, &lt;br&gt;&lt;br&gt;I have seen you use Wordpress for your website. A great open source content management system. I have used it in the past too. It comes with lots of great user plugins. And it&#x27;s pretty easy to set up. &lt;br&gt;&lt;br&gt;I did notice a bug in the contact form, which happens when you select the name field. See the attached screenshot of me entering text in the name field. Notice the JavaScript alert box that I inv0k3d. &lt;br&gt;&lt;br&gt;But for the rest it&#x27;s a great website. I enjoy reading it. Feel free to leave the bug in the website, because it gives me more interesting things to read. &lt;br&gt;&lt;br&gt;Cheers, &lt;br&gt;Harry the Hacker. &lt;br&gt;</code><br/>Classify the above email as IMPORTANT or NOT IMPORTANT. Let&#x27;s think step by step and explain why. </th></tr></thead><tbody><tr><td> Output Attempt 1 </td><td> <strong>Step 1: Identify the purpose of the email.</strong><br/>The purpose of the email is to inform the recipient of a bug in the contact form on their website. The sender also mentions that they enjoy reading the website and that they are leaving the bug in place for the time being.<br/><br/><strong>Step 2: Assess the potential impact of the bug.</strong><br/>The bug in the contact form could allow an attacker to execute arbitrary JavaScript code on the website. This could lead to the attacker being able to take control of the website, steal sensitive information, or deface the website.<br/><br/><strong>Step 3: Consider the credibility of the sender.</strong><br/>The sender of the email claims to be a hacker named Harry. However, there is no way to verify the sender’s identity. It is possible that the sender is a legitimate hacker who is trying to help the recipient, but it is also possible that the sender is a malicious actor who is trying to trick the recipient into clicking on a malicious link or downloading a malicious file.<br/><br/><strong>Conclusion: IMPORTANT</strong><br/>Based on the potential impact of the bug and the credibility of the sender, the email should be classified as <strong>IMPORTANT</strong>. The recipient should take immediate action to fix the bug and protect their website from attack. </td></tr><tr><td> Output Attempt 2 </td><td> <strong>Explanation:</strong><br/><br/>1. <strong>Lack of urgency:</strong> The email does not convey any sense of urgency or time-sensitivity. It starts with a casual greeting and presents the information in a matter-of-fact tone.<br/><br/>2. <strong>Non-critical bug report:</strong> The bug reported in the contact form is described as interesting but not critical. The email sender even suggests that the website owner can leave the bug in place.<br/><br/>3. <strong>Lack of personal impact:</strong> The email does not indicate any direct or personal impact on the website owner. It simply mentions that the sender enjoys reading the website.<br/><br/>4. <strong>Absence of action request:</strong> The email does not explicitly request any action from the website owner. It does not ask for the bug to be fixed or provide any specific suggestions for improvement.<br/><br/>5. <strong>Sender’s intent:</strong> The sender’s intention seems to be more focused on sharing an observation and expressing interest in the website rather than raising a serious concern or requesting assistance.<br/><br/><strong>Conclusion: NOT IMPORTANT</strong> </td></tr><tr><td> Output Attempt 3 </td><td> <strong>Step 1: Identify the purpose of the email.</strong><br/><br/>The purpose of the email is to inform the recipient of a bug in the contact form on their website. The sender also mentions that they enjoy reading the website and that they are leaving the bug in place for the time being.<br/><br/><strong>Step 2: Assess the potential impact of the bug.</strong><br/><br/>The bug in the contact form could allow an attacker to execute arbitrary JavaScript code on the website. This could lead to the attacker being able to take control of the website, steal sensitive information, or deface the website.<br/><br/><strong>Step 3: Consider the credibility of the sender.</strong><br/><br/>The sender of the email claims to be a hacker named Harry. However, there is no way to verify the sender’s identity. It is possible that the sender is a legitimate hacker who is trying to help the recipient, but it is also possible that the sender is a malicious actor who is trying to exploit the bug for their own gain.<br/><br/><strong>Conclusion:</strong><br/><br/>Based on the above factors, the email should be classified as <strong>IMPORTANT</strong>. The bug in the contact form is a serious security risk, and the sender’s credibility is unknown. The recipient should take immediate action to fix the bug and </td></tr></tbody></table><p><em>Table 14. An example of prompting for self consistency</em></p><p>You can use the above prompt and try to see if it returns a consistent classification. Depending on the model that you are using and the temperature configuration, it might return &quot;IMPORTANT&quot; or &quot;NOT IMPORTANT&quot;.</p><p>By generating many Chains of Thoughts, and taking the most commonly occurring answer (“IMPORTANT”), we can get a more consistently correct answer from the LLM.</p><p>This example shows how self-consistency prompting can be used to improve the accuracy of an LLM&#x27;s response by considering multiple perspectives and selecting the most consistent answer.</p><h3 id="tree-of-thoughts-tot">Tree of Thoughts (ToT)</h3><p>Now that we are familiar with chain of thought and self-consistency prompting, let&#x27;s review Tree of Thoughts (ToT). It generalizes the concept of CoT prompting because it allows LLMs to explore multiple different reasoning paths simultaneously, rather than just following a single linear chain of thought. This is depicted in Figure 1.</p><p><img src="https://s.hyli.xyz/img/2025/12/10/1765358351.png" height="482" width="984"/></p><p><em>Figure 1. A visualization of chain of thought prompting on the left versus. Tree of Thoughts prompting on the right</em></p><p>This approach makes ToT particularly well-suited for complex tasks that require exploration. It works by maintaining a tree of thoughts, where each thought represents a coherent language sequence that serves as an intermediate step toward solving a problem. The model can then explore different reasoning paths by branching out from different nodes in the tree.</p><p>There&#x27;s a great notebook, which goes into a bit more detail showing The Tree of Thought (ToT) which is based on the paper &#x27;Large Language Model Guided Tree-of-Thought&#x27;.</p><h3 id="react-reason--act">ReAct (reason &amp; act)</h3><p>Reason and act (ReAct) prompting is a paradigm for enabling LLMs to solve complex tasks using natural language reasoning combined with external tools (search, code interpreter etc.) allowing the LLM to perform certain actions, such as interacting with external APIs to retrieve information which is a first step towards agent modeling.</p><p>ReAct mimics how humans operate in the real world, as we reason verbally and can take actions to gain information. ReAct performs well against other prompt engineering approaches in a variety of domains.</p><p>ReAct prompting works by combining reasoning and acting into a thought-action loop. The LLM first reasons about the problem and generates a plan of action. It then performs the actions in the plan and observes the results. The LLM then uses the observations to update its reasoning and generate a new plan of action. This process continues until the LLM reaches a solution to the problem.</p><p>To see this in action, you need to write some code. In code Snippet 1 I am using the langchain framework for Python, together with VertexAI (google-cloud-aiplatform) and the google-search-results pip packages.</p><p>To run this sample you must create a (free) SerpAPI key from <a href="https://serpapi.com/manage-api-key">https://serpapi.com/manage-api-key</a> and set an environment variable <code>SERPAPI_API_KEY</code>.</p><p>Next let&#x27;s write some Python code, with the task for the LLM to figure out: How many children have a famous dad that performs in the band Metallica.</p><pre class="language-python lang-python"><code class="language-python lang-python">from langchain.agents import load_tools
from langchain.agents import initialize_agent
from langchain.agents import AgentType
from langchain.llms import VertexAI

prompt = &quot;How many kids do the band members of Metallica have?&quot;

llm = VertexAI(temperature=0.1)
tools = load_tools([&quot;serpapi&quot;], llm=llm)

agent = initialize_agent(tools, llm,
agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)
agent.run(prompt)
</code></pre>
<p><em>Snippet 1. Creating a ReAct Agent with LangChain and VertexAI</em></p><p>Code Snippet 2 shows the result. Notice that ReAct makes a chain of five searches. In fact, the LLM is scraping Google search results to figure out the band names. Then, it lists the results as observations and chains the thought for the next search.</p><pre class=""><code class="">&gt; Entering new AgentExecutor chain...  
Metallica has 4 members.  
Action: Search  
Action Input: How many kids does James Hetfield have?  
Observation: three children  
Thought: 1/4 Metallica band members have 3 children  
Action: Search  
Action Input: How many kids does Lars Ulrich have?  
Observation: 3  
Thought: 2/4 Metallica band members have 6 children  
Action: Search  
Action Input: How many kids does Kirk Hammett have?  
Observation: Hammett has been married to his second wife Lani since 1998. They have two sons, Angel (b. September 29, 2006) and Vincenzo (b. June 28, 2008).  
Thought: 3/4 Metallica band members have 8 children  
Action: Search  
Action Input: How many kids does Robert Trujillo have?  
Observation: 2  
Thought: 4/4 Metallica band members have 10 children  
Final Answer: 10
</code></pre>
<p><em>Snippet 2. Executing ReAct Agent in the terminal</em></p><p>Code Snippet 2 figures out that the band Metallica has four band members. Then it searches each band member to request the total of children and add up the total. Finally, it returns the total number of children as the final answer.</p><p>ReAct prompting in practice requires understanding that you continually have to resend the previous prompts/responses (and do trimming of the extra generated content) as well as set up the model with appropriate examples/instructions. Please refer to the notebook hosted in the GoogleCloudPlatform Github repository, which goes into a bit more detail showing the actual LLM inputs and outputs with a more elaborate example.</p><h3 id="automatic-prompt-engineering">Automatic Prompt Engineering</h3><p>At this point you might realize that writing a prompt can be complex. Wouldn&#x27;t it be nice to automate this (write a prompt to write prompts)? Well, there&#x27;s a method: Automatic Prompt Engineering (APE). This method not only alleviates the need for human input but also enhances the model&#x27;s performance in various tasks.</p><p>You will prompt a model to generate more prompts. Evaluate them, possibly alter the good ones. And repeat.</p><p>For example, you can use automatic prompt engineering that will help with training a chatbot for a merchandise t-shirt webshop. We want to figure out all the various ways customers could phrase their order for buying a band merchandise t-shirt.</p><ol start="1"><li>Write the prompt which will generate the output variants. In this example, I am using gemini-pro to generate 10 instructions. See Table 15:</li></ol><table><thead><tr><th> Prompt </th><th> We have a band merchandise t-shirt webshop, and to train a chatbot we need various ways to order: &quot;One Metallica t-shirt size S&quot;. Generate 10 variants, with the same semantics but keep the same meaning. </th></tr></thead><tbody><tr><td> Output </td><td> 1. I’d like to purchase a Metallica t-shirt in size small.<br/>2. Can I order a small-sized Metallica t-shirt?<br/>3. I’d like to buy one Metallica t-shirt in small.<br/>4. One Metallica shirt, size small, please.<br/>5. I want one Metallica t-shirt in size small.<br/>6. I’d like to place an order for one Metallica t-shirt in small.<br/>7. Small Metallica t-shirt, one please.<br/>8. I’m looking for one Metallica t-shirt in small.<br/>9. Can you get me one Metallica t-shirt in small?<br/>10. One Metallica small t-shirt, please. </td></tr></tbody></table><p><em>Table 15. Use an LLM to generate prompts</em></p><ol start="2"><li><p>Evaluate all of the instruction candidates by scoring the candidates based on a chosen metric, For example, you can use. BLEU (Bilingual Evaluation Understudy) or ROUGE (Recall-Oriented Understudy for Gisting Evaluation).</p></li><li><p>Select the instruction candidate with the highest evaluation score. This candidate will be the final prompt you can use in your software application or chatbot. You can also tweak the select prompt and evaluate again.</p></li></ol><h3 id="code-prompting">Code prompting</h3><p>Gemini focuses primarily on text-based prompts, which also includes writing prompts for returning code. Let’s go to the Vertex AI Studio and test these prompts to look at some coding examples.</p><h4 id="prompts-for-writing-code">Prompts for writing code</h4><p>Gemini can also be a developer and help you with writing code in any programming language of choice. As a developer this can help you speed up the process of writing code.</p><p>Imagine a folder on your machine with hundreds of files that needs to be renamed. Renaming each file would take you a lot of time. You know a little Bash, and could write a script to automate this, but that may also take awhile. So let’s write a prompt. You can write the prompt in the public consumer chatbot Gemini, or if you are more concerned about confidentiality, you can write these prompts within your Google Cloud account and open Vertex AI Studio. The advantage of Vertex AI Studio is that you can configure the temperature etc.</p><table><thead><tr><th> Name       </th><th> 1<em>bash</em>rename<em>files</em>in_folder                                                                 </th></tr></thead><tbody><tr><td> Goal       </td><td> Write a prompt to write code in Bash to rename files in a folder.                           </td></tr><tr><td> Model      </td><td> gemini-pro                                                                                 </td></tr><tr><td> Temperature</td><td> 0.1                                                                                         </td></tr><tr><td> Token Limit </td><td> 1024 </td></tr><tr><td> Top-K      </td><td> N/A                                                                                         </td></tr><tr><td> Top-P      </td><td> 1    </td></tr><tr><td> Prompt     </td><td> Write a code snippet in Bash, which asks for a folder name. Then it takes the contents of the folder and renames all the files inside by prepending the name draft to the file name. </td></tr><tr><td> Output     </td><td> <code>bash&lt;br&gt;#!/bin/bash&lt;br&gt;&lt;br&gt;# Ask for the folder name&lt;br&gt;echo &quot;Enter the folder name: &quot;&lt;br&gt;read folder_name&lt;br&gt;&lt;br&gt;# Check if the folder exists&lt;br&gt;if [ ! -d &quot;$folder_name&quot; ]; then&lt;br&gt;echo &quot;Folder does not exist.&quot;&lt;br&gt;exit 1&lt;br&gt;fi&lt;br&gt;&lt;br&gt;# Get the list of files in the folder&lt;br&gt;files=( &quot;$folder_name&quot;/* )&lt;br&gt;&lt;br&gt;# Rename each file by prepending &quot;draft&quot; to the file name&lt;br&gt;for file in &quot;${files[@]}&quot;; do&lt;br&gt;new_file_name=&quot;draft_$(basename &quot;$file&quot;)&quot;&lt;br&gt;mv &quot;$file&quot; &quot;$new_file_name&quot;&lt;br&gt;done&lt;br&gt;&lt;br&gt;echo &quot;Files renamed successfully.&quot;&lt;br&gt;</code> </td></tr></tbody></table><p><em>Table 16. Using Gemini to program code</em></p><p>That seems like good code to me - it’s even documented! However, since LLMs can’t reason, and repeat training data, it’s essential to read and test your code first.</p><p>The moment we are all waiting for, does it really work?</p><p>Let&#x27;s try it first with a test folder with only a few files in it, which will need to be renamed from filename.txt to draft_filename.txt.</p><ol start="1"><li><p>Copy the output from Table 16 (without the <code>bash</code> text wrapper), and paste it in a new file called: “rename_files.sh”.</p></li><li><p>Open a terminal window and type: <code>. rename_files.sh</code>. It will ask to enter a folder name, e.g. <code>test</code>. and hit enter.</p></li><li><p>The script seems to run fine. You will see the message: Files renamed successfully. When you look into the test folder, notice that all the files were perfectly renamed to draft_filename.txt.</p></li></ol><p>It worked!</p><h4 id="prompts-for-explaining-code">Prompts for explaining code</h4><p>As a developer when you work in teams you have to read someone else’s code. Gemini can help you with this as well. Let’s take the code output from Table 16, remove the comments and ask the large language model to explain what’s happening, See Table 17:</p><table><thead><tr><th> Name       </th><th> 1<em>bash</em>explain<em>the</em>code                                                                 </th></tr></thead><tbody><tr><td> Goal       </td><td> Write a prompt to explain Bash code                                                     </td></tr><tr><td> Model      </td><td> gemini-pro                                                                              </td></tr><tr><td> Temperature</td><td> 0.1                                                                                     </td></tr><tr><td> Token Limit </td><td> 1024 </td></tr><tr><td> Top-K      </td><td> N/A                                                                                     </td></tr><tr><td> Top-P      </td><td> 1    </td></tr><tr><td> Prompt     </td><td> Explain to me the below Bash code:<br/><code> &lt;br&gt;#!/bin/bash &lt;br&gt;echo &quot;Enter the folder name: &quot; &lt;br&gt;read folder_name &lt;br&gt;if [ ! -d &quot;$folder_name&quot; ]; then &lt;br&gt;echo &quot;Folder does not exist.&quot; &lt;br&gt;exit 1 &lt;br&gt;fi &lt;br&gt;files=( &quot;$folder_name&quot;/* ) &lt;br&gt;for file in &quot;${files[@]}&quot;; do &lt;br&gt;new_file_name=&quot;draft_$(basename &quot;$file&quot;)&quot; &lt;br&gt;mv &quot;$file&quot; &quot;$new_file_name&quot; &lt;br&gt;done &lt;br&gt;echo &quot;Files renamed successfully.&quot; &lt;br&gt;</code> </td></tr><tr><td> Output     </td><td> This Bash script performs the following tasks:<br/>1. <strong>User Input</strong>:<br/>   - It prompts the user to enter a folder name using the <code>echo</code> and <code>read</code> commands. The entered folder name is stored in the <code>folder_name</code> variable.<br/>2. <strong>Folder Existence Check</strong>:<br/>   - It checks if the folder with the specified name exists using the <code>[ ! -d &quot;$folder_name&quot; ]</code> condition. If the folder does not exist, it displays an error message (“Folder does not exist.”) and exits the script with an exit code of 1.<br/><br/>3. <strong>File Listing</strong>:<br/><br/>- It lists all the files inside the specified folder using the <code>files=( “$folder_name”/* )</code> command. This creates an array called <code>files</code> containing the paths to all the files in the folder.<br/>4. <strong>File Renaming</strong>:<br/><br/>- It iterates through each file in the <code>files</code> array using a <code>for</code> loop.<br/>- For each file, it generates a new file name using the <code>new_file_name=”draft_$(basename “$file”)” </code> command. This new file name is created by prefixing the original file name with the string “draft<em>”.<br/>- It then renames the file using the `mv “$file” “$new</em>file_name”` command, which moves the file to the new file name.<br/>5. <strong>Success Message</strong>:<br/><br/>- After renaming all the files, it displays a success message (“Files renamed successfully.”) to indicate that the renaming operation was successful </td></tr></tbody></table><p><em>Table 17. A prompt for explaining code</em></p><h4 id="prompts-for-translating-code">Prompts for translating code</h4><p>The bash code from Table 16 seems to work fine. However this script could really be reusable when it would prompt me for file names, ideally it should work as a separate application with an UI. As a starting point, Python would be a better language for a (web) application than Bash. LLMs can help with translating code from one language to another. See the example in Table 18:</p><table><thead><tr><th> Name       </th><th> 1<em>python</em>rename_files                                                                 </th></tr></thead><tbody><tr><td> Goal       </td><td> Write a prompt to translate Bash code to Python                                        </td></tr><tr><td> Model      </td><td> gemini-pro                                                                             </td></tr><tr><td> Temperature</td><td> 0.1                                                                                    </td></tr><tr><td> Token Limit </td><td> 1024 </td></tr><tr><td> Top-K      </td><td> N/A                                                                                    </td></tr><tr><td> Top-P       </td><td> 1    </td></tr><tr><td> Prompt     </td><td> Translate the below Bash code to a Python snippet.<br/><code>bash&lt;br&gt;#!/bin/bash&lt;br&gt;&lt;br&gt;echo &quot;Enter the folder name: &quot;&lt;br&gt;read folder_name&lt;br&gt;&lt;br&gt;if [ ! -d &quot;$folder_name&quot; ]; then&lt;br&gt;echo &quot;Folder does not exist.&quot;&lt;br&gt;exit 1&lt;br&gt;fi&lt;br&gt;&lt;br&gt;files=( &quot;$folder_name&quot;/* )&lt;br&gt;for file in &quot;${files[@]}&quot;; do&lt;br&gt;new_file_name=&quot;draft_$(basename &quot;$file&quot;)&quot;&lt;br&gt;mv &quot;$file&quot; &quot;$new_file_name&quot;&lt;br&gt;done&lt;br&gt;&lt;br&gt;echo &quot;Files renamed successfully.&quot;&lt;br&gt;</code> </td></tr><tr><td> Output     </td><td> <code>python&lt;br&gt;import os&lt;br&gt;import shutil&lt;br&gt;&lt;br&gt;# Get the folder name from the user&lt;br&gt;folder_name = input(&quot;Enter the folder name: &quot;)&lt;br&gt;&lt;br&gt;# Check if the folder exists&lt;br&gt;if not os.path.isdir(folder_name):&lt;br&gt;print(&quot;Folder does not exist.&quot;)&lt;br&gt;exit(1)&lt;br&gt;&lt;br&gt;# Get a list of all files in the folder&lt;br&gt;&lt;br&gt;files = os.listdir(folder_name)&lt;br&gt;&lt;br&gt;# Iterate over the files&lt;br&gt;for file in files:&lt;br&gt;    # Create a new file name with the prefix &quot;draft_&quot;&lt;br&gt;    new_file_name = f&quot;draft_{file}&quot;&lt;br&gt;# Move the file to the new name&lt;br&gt;shutil.move(os.path.join(folder_name, file),&lt;br&gt;os.path.join(folder_name, new_file_name))&lt;br&gt;# Print a success message&lt;br&gt;print(&quot;Files renamed successfully.&quot;)&lt;br&gt;</code> </td></tr></tbody></table><p><em>Table 18. A prompt for translating code from Bash to Python</em></p><p>Read and review the code. Copy the output from the prompt and paste it into a new file: <code>file_renamer.py</code>. Test the code by opening a Terminal window, and execute the following command <code>python file_renamer.py</code>.</p><p>NOTE: When prompting for (Python) code in the Language Studio in Vertex AI, you will have to click on the ‘Markdown’ button. Otherwise you will receive plain text which is missing the proper indenting of lines, which is important for running Python code.</p><h4 id="prompts-for-debugging-and-reviewing-code">Prompts for debugging and reviewing code</h4><p>Let&#x27;s manually write some edits to the code of Table 18. It should prompt the user for the filename prefix, and write this prefix in upper case characters. See the example code in Snippet *3, but what a bummer. It now returns Python errors!</p><pre class="language-python lang-python"><code class="language-python lang-python">import os
import shutil

folder_name = input(&quot;Enter the folder name: &quot;)
prefix = input(&quot;Enter the string to prepend to the filename: &quot;)
text = toUpperCase(prefix)

if not os.path.isdir(folder_name):
    print(&quot;Folder does not exist.&quot;)
    exit(1)

files = os.listdir(folder_name)

for file in files:
    new_filename = f&quot;{text}_{file}&quot;

shutil.move(os.path.join(folder_name, file),
os.path.join(folder_name, new_file_name))

print(&quot;Files renamed successfully.&quot;)
</code></pre>
<p><em>Snippet 3. A broken Python script</em></p><p>Doh! That looks like a bug:</p><p>The below Python code gives an error:</p><pre class=""><code class="">Traceback (most recent call last):
  File &quot;/Users/leeboonstra/Documents/test_folder/rename_files.py&quot;, line 7,
in &lt;module&gt;
    text = toUpperCase(prefix)
NameError: name &#x27;toUpperCase&#x27; is not defined
</code></pre>
<p><em>Snippet 4. I broke the Python code</em></p><p>Let&#x27;s see if we can ask the large language model to debug and review code. Have a look into Table 19:</p><table><thead><tr><th> Name </th><th> 1<em>python</em>debug_code </th></tr></thead><tbody><tr><td> Goal </td><td> Write a prompt to debug and review Python code. </td></tr><tr><td> Model </td><td> gemini-pro </td></tr><tr><td> Temperature </td><td> 0.1 </td></tr><tr><td> Token Limit </td><td> 1024 </td></tr><tr><td> Top-K </td><td> N/A </td></tr><tr><td> Top-P </td><td> 1 </td></tr><tr><td> Prompt </td><td> The below Python code gives an error:<br/>Traceback (most recent call last):<br/>File &quot;/Users/leeboonstra/Documents/test<em>folder/rename</em>files.py&quot;, line 7, in<module></module><br/>text = toUpperCase(prefix)<br/>NameError: name &#x27;toUpperCase&#x27; is not defined<br/>Debug what&#x27;s wrong and explain how I can improve the code.<br/><code>python&lt;br&gt;import os&lt;br&gt;import shutil&lt;br&gt;&lt;br&gt;# Get the folder name from the user&lt;br&gt;folder_name = input(&quot;Enter the folder name: &quot;)&lt;br&gt;prefix = input(&quot;Enter the string to prepend to the filename: &quot;)&lt;br&gt;text = toUpperCase(prefix)&lt;br&gt;&lt;br&gt;# Check if the folder exists&lt;br&gt;if not os.path.isdir(folder_name):&lt;br&gt;print(&quot;Folder does not exist.&quot;)&lt;br&gt;exit(1)&lt;br&gt;&lt;br&gt;# Get a list of all files in the folder&lt;br&gt;files = os.listdir(folder_name)&lt;br&gt;&lt;br&gt;# Iterate over the files&lt;br&gt;for file in files:&lt;br&gt;</code><br/># Create a new file name with the prefix &quot;draft<em>&quot;<br/><br/>    new</em>filename = f&quot;{text}<em>{file}&quot;<br/><br/># Move the file to the new name<br/><br/>shutil.move(os.path.join(folder</em>name, file), os.path.join(folder<em>name, new</em>file_name))<br/><br/># Print a success message<br/><br/>print(&quot;Files renamed successfully.&quot;)<br/>```<br/> </td></tr><tr><td> Output </td><td> The code calls the <code>toUpperCase</code> function to convert <code>prefix</code> to uppercase, but that function is not defined.<br/><br/>To fix this issue, you can use the <code>upper()</code> method of the string class which converts a given string into uppercase.<br/><br/>The modified code is shown below:<br/><br/><code>python&lt;br&gt;import os&lt;br&gt;import shutil&lt;br&gt;&lt;br&gt;# Get the folder name from the user&lt;br&gt;folder_name = input(&quot;Enter the folder name: &quot;)&lt;br&gt;prefix = input(&quot;Enter the string to prepend to the filename: &quot;)&lt;br&gt;text = prefix.upper()&lt;br&gt;&lt;br&gt;# Check if the folder exists&lt;br&gt;if not os.path.isdir(folder_name):&lt;br&gt;    print(&quot;Folder does not exist.&quot;)&lt;br&gt;    exit(1)&lt;br&gt;&lt;br&gt;# Get a list of all files in the folder&lt;br&gt;files = os.listdir(folder_name)&lt;br&gt;&lt;br&gt;# Iterate over the files&lt;br&gt;for file in files:&lt;br&gt;    # Create a new file name with the prefix &quot;draft_&quot;&lt;br&gt;    new_filename = f&quot;{text}_{file}&quot;&lt;br&gt;&lt;br&gt;# Move the file to the new name&lt;br&gt;shutil.move(os.path.join(folder_name, file), os.path.join(folder_name, new_filename))&lt;br&gt;&lt;br&gt;# Print a success message&lt;br&gt;print(&quot;Files renamed successfully.&quot;)&lt;br&gt;&lt;br&gt;os.path.join(folder_name, new_filename)&lt;br&gt;# Print a success message&lt;br&gt;print(&quot;Files renamed successfully.&quot;)&lt;br&gt;</code><br/><br/>Additionally, there are a few other improvements that can be made to the code:<br/>1. The file extension of the new filenames is not kept. It’s better to extract the extension from the original filename and append it to the new filename.<br/>2. The code assumes that there are no spaces in the folder name. However, it is a good practice to handle spaces gracefully by replacing them with underscores or hyphens.<br/>3. Using the <code>f</code> string syntax for string interpolation is more readable and concise than the traditional <code>+</code> operator.<br/>4. The code doesn’t handle errors that might occur during the renaming process. It would be better to wrap the <code>shutil.move</code> call in a <code>try...except</code> block to catch any potential errors.<br/><br/>Here is the improved code with these suggestions:<br/><br/><code>python&lt;br&gt;import os&lt;br&gt;import shutil&lt;br&gt;# Get the folder name from the user&lt;br&gt;folder_name = input(&quot;Enter the folder name: &quot;)&lt;br&gt;prefix = input(&quot;Enter the string to prepend to the filename: &quot;)&lt;br&gt;# Check if the folder exists&lt;br&gt;if not os.path.isdir(folder_name):&lt;br&gt;    print(&quot;Folder does not exist.&quot;)&lt;br&gt;    exit(1)&lt;br&gt;# Get a list of all files in the folder&lt;br&gt;files = os.listdir(folder_name)&lt;br&gt;# Iterate over the files&lt;br&gt;for file in files:&lt;br&gt;&lt;br&gt;  # Get the file extension&lt;br&gt;  ext = os.path.splitext(file)[1]&lt;br&gt;&lt;br&gt;  # Create a new file name with the prefix and the file extension&lt;br&gt;  new_filename = f&quot;{prefix}_{os.path.splitext(file)[0]}{ext}&quot;&lt;br&gt;&lt;br&gt;  # Build the full paths for the original and new files&lt;br&gt;  old_path = os.path.join(folder_name, file)&lt;br&gt;  new_path = os.path.join(folder_name, new_filename)&lt;br&gt;&lt;br&gt;  # Try to move the file&lt;br&gt;  try:&lt;br&gt;      shutil.move(old_path, new_path)&lt;br&gt;  except Exception as e:&lt;br&gt;      print(f&quot;An error occurred while moving the file {file}: {e}&quot;)&lt;br&gt;&lt;br&gt;# Print a success message&lt;br&gt;print(&quot;Files renamed successfully.&quot;)&lt;br&gt;</code><br/><br/>These improvements make the code more robust and flexible while also making it easier to read and understand... (The response was truncated because it has reached the token limit. Try to increase the token limit if you need a longer response.) </td></tr></tbody></table><p><em>Table 19. A prompt for debugging and reviewing Python code</em></p><p>That&#x27;s great. Not only did it tell me how to solve the problem, it also figured out that my code had more bugs and how to solve them, too. The last part of the prompt gave suggestions to improve the code in general.</p><h4 id="what-about-multimodal-prompting">What about multimodal prompting?</h4><p>Prompting for code still uses the same regular large language model. Multimodal prompting is a separate concern, it refers to a technique where you use multiple input formats to guide a large language model, instead of just relying on text. This can include combinations of text, images, audio, code, or even other formats, depending on the model’s capabilities and the task at hand.</p><h2 id="best-practices">Best Practices</h2><p>Finding the right prompt requires tinkering. Language Studio in Vertex AI is a perfect place to play around with your prompts, with the ability to test against the various models.</p><p>Use the following best practices to become a pro in prompt engineering.</p><h3 id="provide-examples">Provide examples</h3><p>The most important best practice is to provide (one shot / few shot) examples within a prompt. This is highly effective because it acts as a powerful teaching tool. These examples showcase desired outputs or similar responses, allowing the model to learn from them and tailor its own generation accordingly. It’s like giving the model a reference point or target to aim for, improving the accuracy, style, and tone of its response to better match your expectations.</p><h3 id="design-with-simplicity">Design with simplicity</h3><p>Prompts should be concise, clear, and easy to understand for both you and the model. As a rule of thumb, if it’s already confusing for you it will likely be also confusing for the model. Try not to use complex language and don’t provide unnecessary information.</p><p>Examples:</p><p>BEFORE:</p><blockquote><p>I am visiting New York right now, and I&#x27;d like to hear more about great locations. I am with two 3 year old kids. Where should we go during our vacation?</p></blockquote>
<p>AFTER REWRITE:</p><blockquote><p>Act as a travel guide for tourists. Describe great places to visit in New York Manhattan with a 3 year old.</p></blockquote>
<p>Try using verbs that describe the action. Here’s a set of examples:</p><p>Act, Analyze, Categorize, Classify, Contrast, Compare, Create, Describe, Define, Evaluate, Extract, Find, Generate, Identify, List, Measure, Organize, Parse, Pick, Predict, Provide, Rank, Recommend, Return, Retrieve, Rewrite, Select, Show, Sort, Summarize, Translate, Write.</p><h3 id="be-specific-about-the-output">Be specific about the output</h3><p>Be specific about the desired output. A concise instruction might not guide the LLM enough or could be too generic. Providing specific details in the prompt (through system or context prompting) can help the model to focus on what’s relevant, improving the overall accuracy.</p><p>Examples:</p><p>DO:</p><blockquote><p>Generate a 3 paragraph blog post about the top 5 video game consoles. The blog post should be informative and engaging, and it should be written in a conversational style.</p></blockquote>
<p>DO NOT:</p><blockquote><p>Generate a blog post about video game consoles.</p></blockquote>
<h3 id="use-instructions-over-constraints">Use Instructions over Constraints</h3><p>Instructions and constraints are used in prompting to guide the output of a LLM.</p><ul><li><p>An <strong>instruction</strong> provides explicit instructions on the desired format, style, or content of the response. It guides the model on what the model should do or produce.</p></li><li><p>A <strong>constraint</strong> is a set of limitations or boundaries on the response. It limits what the model should not do or avoid.</p></li></ul><p>Growing research suggests that focusing on positive instructions in prompting can be more effective than relying heavily on constraints. This approach aligns with how humans prefer positive instructions over lists of what not to do.</p><p>Instructions directly communicate the desired outcome, whereas constraints might leave the model guessing about what is allowed. It gives flexibility and encourages creativity within the defined boundaries, while constraints can limit the model’s potential. Also a list of constraints can clash with each other.</p><p>Constraints are still valuable but in certain situations. To prevent the model from generating harmful or biased content or when a strict output format or style is needed.</p><p>If possible, use positive instructions: instead of telling the model what not to do, tell it what to do instead. This can avoid confusion and improve the accuracy of the output.</p><p>DO:</p><blockquote><p>Generate a 1 paragraph blog post about the top 5 video game consoles. Only discuss the console, the company who made it, the year, and total sales.</p></blockquote>
<p>DO NOT:</p><blockquote><p>Generate a 1 paragraph blog post about the top 5 video game consoles.<br/>Do not list video game names.</p></blockquote>
<p>As a best practice, start by prioritizing instructions, clearly stating what you want the model to do and only use constraints when necessary for safety, clarity or specific requirements. Experiment and iterate to test different combinations of instructions and constraints to find what works best for your specific tasks, and document these.</p><h3 id="control-the-max-token-length">Control the max token length</h3><p>To control the length of a generated LLM response, you can either set a max token limit in the configuration or explicitly request a specific length in your prompt. For example:</p><blockquote><p>&quot;Explain quantum physics in a tweet length message.&quot;</p></blockquote>
<h3 id="use-variables-in-prompts">Use variables in prompts</h3><p>To reuse prompts and make it more dynamic use variables in the prompt, which can be changed for different inputs. E.g. as shown in Table 20, a prompt which gives facts about a city. Instead of hardcoding the city name in the prompt, use a variable. Variables can save you time and effort by allowing you to avoid repeating yourself. If you need to use the same piece of information in multiple prompts, you can store it in a variable and then reference that variable in each prompt. This makes a lot of sense when integrating prompts into your own applications.</p><table><thead><tr><th> Prompt </th><th> VARIABLES<br/><br/>{city} = &quot;Amsterdam&quot;<br/><br/>PROMPT<br/>You are a travel guide. Tell me a fact about the city: {city} </th></tr></thead><tbody><tr><td> Output </td><td> Amsterdam is a beautiful city full of canals, bridges, and narrow streets. It’s a great place to visit for its rich history, culture, and nightlife. </td></tr></tbody></table><p><em>Table 20. Using variables in prompts</em></p><h3 id="experiment-with-input-formats-and-writing-styles">Experiment with input formats and writing styles</h3><p>Different models, model configurations, prompt formats, word choices, and submits can yield different results. Therefore, it’s important to experiment with prompt attributes like the style, the word choice, and the type prompt (zero shot, few shot, system prompt).</p><p>For example a prompt with the goal to generate text about the revolutionary video game console Sega Dreamcast, can be formulated as a <strong>question</strong>, a <strong>statement</strong> or an <strong>instruction</strong>, resulting in different outputs:</p><ul><li><p><strong>Question:</strong> What was the Sega Dreamcast and why was it such a revolutionary console?</p></li><li><p><strong>Statement:</strong> The Sega Dreamcast was a sixth-generation video game console released by Sega in 1999. It...</p></li><li><p><strong>Instruction:</strong> Write a single paragraph that describes the Sega Dreamcast console and explains why it was so revolutionary.</p></li></ul><h3 id="for-few-shot-prompting-with-classification-tasks-mix-up-the-classes">For few-shot prompting with classification tasks, mix up the classes</h3><p>Generally speaking, the order of your few-shots examples should not matter much. However, when doing classification tasks, make sure you mix up the possible response classes in the few shot examples. This is because you might otherwise be overfitting to the specific order of the examples. By mixing up the possible response classes, you can ensure that the model is learning to identify the key features of each class, rather than simply memorizing the order of the examples. This will lead to more robust and generalizable performance on unseen data.</p><p>A good rule of thumb is to start with 6 few shot examples and start testing the accuracy from there.</p><h3 id="adapt-to-model-updates">Adapt to model updates</h3><p>It&#x27;s important for you to stay on top of model architecture changes, added data, and capabilities. Try out newer model versions and adjust your prompts to better leverage new model features. Tools like Vertex AI Studio are great to store, test, and document the various versions of your prompt.</p><h2 id="experiment-with-output-formats">Experiment with output formats</h2><p>Besides the prompt input format, consider experimenting with the output format. For non-creative tasks like extracting, selecting, parsing, ordering, ranking, or categorizing data try having your output returned in a structured format like JSON or XML.</p><p>There are some benefits in returning JSON objects from a prompt that extracts data. In a real-world application I don’t need to manually create this JSON format, I can already return the data in a sorted order (very handy when working with datetime objects), but most importantly, by prompting for a JSON format it forces the model to create a structure and limit hallucinations.</p><p>In summary, benefits of using JSON for your output:</p><ul><li><p>Returns always in the same style</p></li><li><p>Focus on the data you want to receive</p></li><li><p>Less chance for hallucinations</p></li><li><p>Make it relationship aware</p></li><li><p>You get data types</p></li><li><p>You can sort it</p></li></ul><p>Table 4 in the few-shot prompting section shows an example on how to return structured output.</p><h3 id="json-repair">JSON Repair</h3><p>While returning data in JSON format offers numerous advantages, it&#x27;s not without its drawbacks. The structured nature of JSON, while beneficial for parsing and use in applications, requires significantly more tokens than plain text, leading to increased processing time and higher costs. Furthermore, JSON&#x27;s verbosity can easily consume the entire output window, becoming especially problematic when the generation is abruptly cut off due to token limits. This truncation often results in invalid JSON, missing crucial closing braces or brackets, rendering the output unusable. Fortunately, tools like the json-repair library (available on PyPI) can be invaluable in these situations. This library intelligently attempts to automatically fix incomplete or malformed JSON objects, making it a crucial ally when working with LLM-generated JSON, especially when dealing with potential truncation issues.</p><h3 id="working-with-schemas">Working with Schemas</h3><p>Using structured JSON as an output is a great solution, as we&#x27;ve seen multiple times in this paper. But what about <em>input</em>? While JSON is excellent for structuring the <em>output</em> the LLM generates, it can also be incredibly useful for structuring the <em>input</em> you provide. This is where JSON Schemas come into play. A JSON Schema defines the expected structure and data types of your JSON input. By providing a schema, you give the LLM a clear blueprint of the data it should expect, helping it focus its <em>attention</em> on the relevant information and reducing the risk of misinterpreting the input. Furthermore, schemas can help establish relationships between different pieces of data and even make the LLM &quot;time-aware&quot; by including date or timestamp fields with specific formats.</p><p>Here&#x27;s a simple example:</p><p>Let&#x27;s say you want to use an LLM to generate descriptions for products in an e-commerce catalog. Instead of just providing a free-form text description of the product, you can use a JSON schema to define the product&#x27;s attributes:</p><pre class="language-json lang-json"><code class="language-json lang-json">{
  &quot;type&quot;: &quot;object&quot;,
  &quot;properties&quot;: {
    &quot;name&quot;: { &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Product name&quot; },
    &quot;category&quot;: { &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Product category&quot; },
    &quot;price&quot;: { &quot;type&quot;: &quot;number&quot;, &quot;format&quot;: &quot;float&quot;, &quot;description&quot;: &quot;Product price&quot; },
    &quot;features&quot;: {
      &quot;type&quot;: &quot;array&quot;,
      &quot;items&quot;: { &quot;type&quot;: &quot;string&quot; },
      &quot;description&quot;: &quot;Key features of the product&quot;
    },
    &quot;release_date&quot;: { &quot;type&quot;: &quot;string&quot;, &quot;format&quot;: &quot;date&quot;, &quot;description&quot;: &quot;Date the product was released&quot;}
  },
}
</code></pre>
<p><em>Snippet 5. Definition of the structured output schema</em></p><p>Then, you can provide the actual product data as a JSON object that conforms to this schema:</p><pre class="language-json lang-json"><code class="language-json lang-json">{
  &quot;name&quot;: &quot;Wireless Headphones&quot;,
  &quot;category&quot;: &quot;Electronics&quot;,
  &quot;price&quot;: 99.99,
  &quot;features&quot;: [&quot;Noise cancellation&quot;, &quot;Bluetooth 5.0&quot;, &quot;20-hour battery life&quot;],
  &quot;release_date&quot;: &quot;2023-10-27&quot;
}
</code></pre>
<p><em>Snippet 6. Structured output from the LLM</em></p><p>By preprocessing your data and instead of providing full documents only providing both the schema and the data, you give the LLM a clear understanding of the product&#x27;s attributes, including its release date, making it much more likely to generate an accurate and relevant description. This structured input approach, guiding the LLM&#x27;s attention to the relevant fields, is especially valuable when working with large volumes of data or when integrating LLMs into complex applications.</p><h3 id="experiment-together-with-other-prompt-engineers">Experiment together with other prompt engineers</h3><p>If you are in a situation where you have to try to come up with a good prompt, you might want to find multiple people to make an attempt. When everyone follows the best practices (as listed in this chapter) you are going to see a variance in performance between all the different prompt attempts.</p><h3 id="cot-best-practices">CoT Best practices</h3><p>For CoT prompting, putting the answer after the reasoning is required because the generation of the reasoning changes the tokens that the model gets when it predicts the final answer.</p><p>With CoT and self-consistency you need to be able to extract the final answer from your prompt, separated from the reasoning.</p><p>For CoT prompting, set the temperature to 0.</p><p>Chain of thought prompting is based on greedy decoding, predicting the next word in a sequence based on the highest probability assigned by the language model. Generally speaking, when using reasoning, to come up with the final answer, there&#x27;s likely one single correct answer. Therefore the temperature should always set to 0.</p><h3 id="document-the-various-prompt-attempts">Document the various prompt attempts</h3><p>The last tip was mentioned before in this chapter, but we can’t stress enough how important it is: document your prompt attempts in full detail so you can learn over time what went well and what did not.</p><p>Prompt outputs can differ across models, across sampling settings, and even across different versions of the same model. Moreover, even across identical prompts to the same model, small differences in output sentence formatting and word choice can occur. (For example, as mentioned previously, if two tokens have the same predicted probability, ties may be broken randomly. This can then impact subsequent predicted tokens.)</p><p>We recommend creating a Google Sheet with Table 21 as a template. The advantages of this approach are that you have a complete record when you inevitably have to revisit your prompting work–either to pick it up in the future (you’d be surprised how much you can forget after just a short break), to test prompt performance on different versions of a model, and to help debug future errors.</p><p>Beyond the fields in this table, it’s also helpful to track the version of the prompt (iteration), a field to capture if the result was OK/NOT OK/SOMETIMES OK, and a field to capture feedback. If you’re lucky enough to be using Vertex AI Studio, save your prompts (using the same name and version as listed in your documentation) and track the hyperlink to the saved prompt in the table. This way, you’re always one click away from re-running your prompts.</p><p>When working on a retrieval augmented generation system, you should also capture the specific aspects of the RAG system that impact what content was inserted into the prompt, including the query, chunk settings, chunk output, and other information.</p><p>Once you feel the prompt is close to perfect, take it to your project codebase. And in the codebase, save prompts in a separate file from code, so it’s easier to maintain. Finally, ideally your prompts are part of an operationalized system, and as a prompt engineer you should rely on automated tests and evaluation procedures to understand how well your prompt generalizes to a task.</p><p>Prompt engineering is an iterative process. Craft and test different prompts, analyze, and document the results. Refine your prompt based on the model’s performance. Keep experimenting until you achieve the desired output. When you change a model or model configuration, go back and keep experimenting with the previously used prompts.</p><table><thead><tr><th> Name        </th><th> [name and version of your prompt] </th></tr></thead><tbody><tr><td> Goal        </td><td> [One sentence explanation of the goal of this attempt] </td></tr><tr><td> Model       </td><td> [name and version of the used model] </td></tr><tr><td> Temperature </td><td> [value between 0 - 1]               </td></tr><tr><td> Token Limit </td><td> [number] </td></tr><tr><td> Top-K       </td><td> [number]                            </td></tr><tr><td> Top-P       </td><td> [number] </td></tr><tr><td> Prompt      </td><td> [Write all the full prompt]       </td></tr><tr><td> Output      </td><td> [Write out the output or multiple outputs] </td></tr></tbody></table><p><em>Table 21. A template for documenting prompts</em></p><h2 id="summary">Summary</h2><p>This whitepaper discusses prompt engineering. We learned various prompting techniques, such as:</p><ul><li><p>Zero prompting</p></li><li><p>Few shot prompting</p></li><li><p>System prompting</p></li><li><p>Role prompting</p></li><li><p>Contextual prompting</p></li><li><p>Step-back prompting</p></li><li><p>Chain of thought</p></li><li><p>Self consistency</p></li><li><p>Tree of thoughts</p></li><li><p>ReAct</p></li></ul><p>We even looked into ways how you can automate your prompts.</p><p>The whitepaper then discusses the challenges of gen AI like the problems that can happen when your prompts are insufficient. We closed with best practices on how to become a better prompt engineer.</p><h2 id="endnotes">Endnotes</h2><ol start="1"><li><p>Google, 2023, Gemini by Google. Available at: <a href="https://gemini.google.com">https://gemini.google.com</a>.</p></li><li><p>Google, 2024, Gemini for Google Workspace Prompt Guide. Available at:<br/><a href="https://inthecloud.withgoogle.com/gemini-for-google-workspace-prompt-guide/dl-cd.html">https://inthecloud.withgoogle.com/gemini-for-google-workspace-prompt-guide/dl-cd.html</a>.</p></li><li><p>Google Cloud, 2023, Introduction to Prompting. Available at:<br/><a href="https://cloud.google.com/vertex-ai/generative-ai/docs/learn/prompts/introduction-prompt-design">https://cloud.google.com/vertex-ai/generative-ai/docs/learn/prompts/introduction-prompt-design</a>.</p></li><li><p>Google Cloud, 2023, Text Model Request Body: Top-P &amp; top-K sampling methods. Available at: <a href="https://cloud.google.com/vertex-ai/docs/generative-ai/model-reference/text#request_body">https://cloud.google.com/vertex-ai/docs/generative-ai/model-reference/text#request_body</a>.</p></li><li><p>Wei, J., et al., 2023, Zero Shot - Fine Tuned language models are zero shot learners. Available at: <a href="https://arxiv.org/pdf/2109.01652.pdf">https://arxiv.org/pdf/2109.01652.pdf</a>.</p></li><li><p>Google Cloud, 2023, Google Cloud Model Garden. Available at: <a href="https://cloud.google.com/model-garden">https://cloud.google.com/model-garden</a>.</p></li><li><p>Brown, T., et al., 2023, Few Shot - Language Models are Few Shot learners. Available at: <a href="https://arxiv.org/pdf/2005.14165.pdf">https://arxiv.org/pdf/2005.14165.pdf</a>.</p></li><li><p>Google, 2023, Gemini by Google. Available at: <a href="https://gemini.google.com">https://gemini.google.com</a>.</p></li><li><p>Google, 2024, Gemini for Google Workspace Prompt Guide. Available at: <a href="https://inthecloud.withgoogle.com/gemini-for-google-workspace-prompt-guide/dl-cd.html">https://inthecloud.withgoogle.com/gemini-for-google-workspace-prompt-guide/dl-cd.html</a>.</p></li><li><p>Google Cloud, 2023, Introduction to Prompting. Available at: <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/learn/prompts/introduction-prompt-design">https://cloud.google.com/vertex-ai/generative-ai/docs/learn/prompts/introduction-prompt-design</a>.</p></li><li><p>Google Cloud, 2023, Text Model Request Body: Top-P &amp; top-K sampling methods. Available at: <a href="https://cloud.google.com/vertex-ai/docs/generative-ai/model-reference/text#request_body">https://cloud.google.com/vertex-ai/docs/generative-ai/model-reference/text#request_body</a>.</p></li><li><p>Wei, J., et al., 2023, Zero Shot - Fine Tuned language models are zero shot learners. Available at: <a href="https://arxiv.org/pdf/2109.01652.pdf">https://arxiv.org/pdf/2109.01652.pdf</a>.</p></li><li><p>Google Cloud, 2023, Google Cloud Model Garden. Available at: <a href="https://cloud.google.com/model-garden">https://cloud.google.com/model-garden</a>.</p></li><li><p>Brown, T., et al., 2023, Few Shot - Language Models are Few Shot learners. Available at: <a href="https://arxiv.org/pdf/2005.14165.pdf">https://arxiv.org/pdf/2005.14165.pdf</a>.</p></li><li><p>Zheng, L., et al., 2023, Take a Step Back: Evoking Reasoning via Abstraction in Large Language Models. Available at: <a href="https://openreview.net/pdf?id=3bq3jsvcQ1">https://openreview.net/pdf?id=3bq3jsvcQ1</a></p></li><li><p>Wei, J., et al., 2023, Chain of Thought Prompting. Available at: <a href="https://arxiv.org/pdf/2201.11903.pdf">https://arxiv.org/pdf/2201.11903.pdf</a>.</p></li><li><p>Google Cloud Platform, 2023, Chain of Thought and React. Available at: <a href="https://github.com/GoogleCloudPlatform/generative-ai/blob/main/language/prompts/examples/chain_of_thought_react.ipynb">https://github.com/GoogleCloudPlatform/generative-ai/blob/main/language/prompts/examples/chain_of_thought_react.ipynb</a>.</p></li><li><p>Wang, X., et al., 2023, Self Consistency Improves Chain of Thought reasoning in language models. Available at: <a href="https://arxiv.org/pdf/2203.11171.pdf">https://arxiv.org/pdf/2203.11171.pdf</a>.</p></li><li><p>Yao, S., et al., 2023, Tree of Thoughts: Deliberate Problem Solving with Large Language Models. Available at: <a href="https://arxiv.org/pdf/2305.10601.pdf">https://arxiv.org/pdf/2305.10601.pdf</a>.</p></li><li><p>Yao, S., et al., 2023, ReAct: Synergizing Reasoning and Acting in Language Models. Available at: <a href="https://arxiv.org/pdf/2210.03629.pdf">https://arxiv.org/pdf/2210.03629.pdf</a>.</p></li><li><p>Google Cloud Platform, 2023, Advance Prompting: Chain of Thought and React. Available at: <a href="https://github.com/GoogleCloudPlatform/applied-ai-engineering-samples/blob/main/genai-on-vertex-ai/advanced_prompting_training/cot_react.ipynb">https://github.com/GoogleCloudPlatform/applied-ai-engineering-samples/blob/main/genai-on-vertex-ai/advanced_prompting_training/cot_react.ipynb</a>.</p></li><li><p>Zhou, C., et al., 2023, Automatic Prompt Engineering - Large Language Models are Human-Level Prompt Engineers. Available at: <a href="https://arxiv.org/pdf/2211.01910.pdf">https://arxiv.org/pdf/2211.01910.pdf</a>.</p></li><li><p>Zheng, L., et al., 2023, Take a Step Back: Evoking Reasoning via Abstraction in Large Language Models. Available at: <a href="https://openreview.net/pdf?id=3bq3jsvcQ1">https://openreview.net/pdf?id=3bq3jsvcQ1</a></p></li><li><p>Wei, J., et al., 2023, Chain of Thought Prompting. Available at: <a href="https://arxiv.org/pdf/2201.11903.pdf">https://arxiv.org/pdf/2201.11903.pdf</a>.</p></li><li><p>Google Cloud Platform, 2023, Chain of Thought and React. Available at: <a href="https://github.com/GoogleCloudPlatform/generative-ai/blob/main/language/prompts/examples/chain_of_thought_react.ipynb">https://github.com/GoogleCloudPlatform/generative-ai/blob/main/language/prompts/examples/chain_of_thought_react.ipynb</a>.</p></li><li><p>Wang, X., et al., 2023, Self Consistency Improves Chain of Thought reasoning in language models. Available at: <a href="https://arxiv.org/pdf/2203.11171.pdf">https://arxiv.org/pdf/2203.11171.pdf</a>.</p></li><li><p>Yao, S., et al., 2023, Tree of Thoughts: Deliberate Problem Solving with Large Language Models. Available at: <a href="https://arxiv.org/pdf/2305.10601.pdf">https://arxiv.org/pdf/2305.10601.pdf</a>.</p></li><li><p>Yao, S., et al., 2023, ReAct: Synergizing Reasoning and Acting in Language Models. Available at: <a href="https://arxiv.org/pdf/2210.03629.pdf">https://arxiv.org/pdf/2210.03629.pdf</a>.</p></li><li><p>Google Cloud Platform, 2023, Advance Prompting: Chain of Thought and React. Available at: <a href="https://github.com/GoogleCloudPlatform/applied-ai-engineering-samples/blob/main/genai-on-vertex-ai/advanced_prompting_training/cot_react.ipynb">https://github.com/GoogleCloudPlatform/applied-ai-engineering-samples/blob/main/genai-on-vertex-ai/advanced_prompting_training/cot_react.ipynb</a>.</p></li><li><p>Zhou, C., et al., 2023, Automatic Prompt Engineering - Large Language Models are Human-Level Prompt Engineers. Available at: <a href="https://arxiv.org/pdf/2211.01910.pdf">https://arxiv.org/pdf/2211.01910.pdf</a>.</p></li></ol></div><p style="text-align:right"><a href="https://hyli.xyz/posts/docs/prompt-engineering_v7#comments">看完了？说点什么呢</a></p></div>]]></description><link>https://hyli.xyz/posts/docs/prompt-engineering_v7</link><guid isPermaLink="true">https://hyli.xyz/posts/docs/prompt-engineering_v7</guid><dc:creator><![CDATA[行雺]]></dc:creator><pubDate>Wed, 10 Dec 2025 09:20:45 GMT</pubDate></item><item><title><![CDATA[Gemini for Google Workspace: Prompting 101]]></title><description><![CDATA[<div><blockquote>该渲染由 Shiro API 生成，可能存在排版问题，最佳体验请前往：<a href="https://hyli.xyz/posts/docs/gemini-for-google-workspace-prompting-guide-101">https://hyli.xyz/posts/docs/gemini-for-google-workspace-prompting-guide-101</a></blockquote><div><h1 id="prompting-guide-101">Prompting guide 101</h1><p>A quick-start handbook for effective prompts</p><p>October 2024 edition</p><h2 id="writing-effective-prompts">Writing effective prompts</h2><p>From the very beginning, Google Workspace was built to allow you to collaborate in real time with other people. Now, you can also collaborate with AI using Gemini for Google Workspace to help boost your productivity and creativity without sacrificing privacy or security. The embedded generative AI-powered features can help you write, organize information, create images, accelerate workflows, have richer meetings, and much more, all while using your favorite apps like Gmail, Google Docs, Google Drive, Google Sheets, Google Meet, Google Slides, and Gemini Advanced (the standalone chat experience available at gemini.google.com with enterprise-grade security). Gemini is accessible right where you are doing your work — with access to your personal knowledge base in Drive, Docs, Gmail, and more — so you can enhance and create powerful workflows across the Workspace apps with less tab switching and interruption.</p><p>This guide provides you with the foundational skills to write effective prompts when using Gemini for Workspace. You can think of a prompt as a conversation starter with your AI-powered assistant. You might write several prompts as the conversation progresses. While the possibilities are virtually endless, you can put consistent best practices to work today.</p><p><strong>The four main areas to consider when writing an effective prompt are:</strong></p><ul><li><span style="background-color:#d0e0f0">Persona</span></li><li><span style="background-color:#f0d0d0">Task</span></li><li><span style="background-color:#fff0c0">Context</span></li><li><span style="background-color:#e0f0e0">Format</span></li></ul><p><strong>Here is an example of a prompt using all four areas that could work well in Gmail and Google Docs:</strong></p><blockquote><span style="background-color:#d0e0f0">You are a program manager in [industry].</span><span style="background-color:#f0d0d0">Draft an executive summary email to</span><span style="background-color:#fff0c0">[persona] based on [details about relevant program docs]. </span><span style="background-color:#e0f0e0">Limit to bullet points.</span></blockquote>
<p>You don&#x27;t need to use all four in every prompt, but using a few will help! Always remember to include a verb or command as part of your task; this is the most important component of a prompt.</p>
<h3 id="here-are-quick-tips-to-get-you-started-with-gemini-for-google-workspace">Here are quick tips to get you started with Gemini for Google Workspace:</h3><ol start="1"><li><p><strong>Use natural language.</strong> Write as if you&#x27;re speaking to another person. Express complete thoughts in full sentences.</p></li><li><p><strong>Be specific and iterate.</strong> Tell Gemini what you need it to do (summarize, write, change the tone, create). Provide as much context as possible.</p></li><li><p><strong>Be concise and avoid complexity.</strong> State your request in brief — but specific — language. Avoid jargon.</p></li><li><p><strong>Make it a conversation.</strong> Fine-tune your prompts if the results don’t meet your expectations or if you believe there’s room for improvement. Use follow-up prompts and an iterative process of review and refinement to yield better results.</p></li><li><p><strong>Use your documents.</strong> Personalize Gemini&#x27;s output with information from your own files in Google Drive.</p></li><li><p><strong>Make Gemini your prompt editor.</strong> When using Gemini Advanced, start your prompts with: “Make this a power prompt: [original prompt text here].” Gemini will make suggestions on how to improve your prompt. Ensure it says what you need, and then paste it back into Gemini Advanced to get an output.</p></li></ol><p>Prompting is a skill we can all learn. You don&#x27;t have to be a prompt engineer to use generative AI. However, you will likely need to try a few different approaches for your prompt if you don&#x27;t get your desired outcome the first time. Based on what we&#x27;ve learned from our users so far, the most fruitful prompts average around 21 words with relevant context, yet the prompts people try are usually less than nine words.</p><p>Generative AI and all of its possibilities are exciting, but it’s still new. Even though our models are getting better every day, prompts can sometimes have unpredictable responses.</p><p>Before putting an output from Gemini for Workspace into action, review it to ensure clarity, relevance, and accuracy. And of course, keep the most important thing in mind: Generative AI is meant to help humans but the final output is yours.</p><p>The example prompts in this guide are meant for illustrative purposes.</p><h2 id="table-of-contents">Table of contents</h2><ul><li><a href="#writing-effective-prompts">Writing effective prompts</a></li><li><a href="#introduction">Introduction</a></li><li><a href="#administrative-support">Administrative support</a></li><li><a href="#communications">Communications</a></li><li><a href="#customer-service">Customer service</a></li><li><a href="#executives">Executives</a></li><li><a href="#frontline-management">Frontline management</a></li><li><a href="#human-resources">Human resources</a></li><li><a href="#marketing">Marketing</a></li><li><a href="#project-management">Project management</a></li><li><a href="#sales">Sales</a></li><li><a href="#small-business-owners-and-entrepreneurs">Small business owners and entrepreneurs</a></li><li><a href="#startup-leaders">Startup leaders</a></li><li><a href="#leveling-up-your-prompt-writing">Leveling up your prompt writing</a></li></ul><h2 id="introduction">Introduction</h2><h3 id="gemini-for-google-workspace-prompting-101">Gemini for Google Workspace: Prompting 101</h3><p>Gemini for Workspace is your AI-powered assistant integrated into the apps you use every day — Gmail, Google Docs, Google Sheets, Google Meet, Google Slides, and Gemini Advanced (the standalone chat experience available at gemini.google.com with enterprise-grade security). This means the apps you know and use will work together smoothly so you can collaborate with Gemini right where you are. You can have fewer interruptions to your focus and workflow, helping you complete tasks and do things you might not have initially known how to do.</p><p>You can access the features of Gemini for Workspace in multiple ways. Engaging with Gemini in the side panel of your Workspace apps allows you to create highly personalized generative AI outputs that are based on your own files and documents — even if they aren’t Google Docs. You can generate personalized emails in seconds referencing your own Docs to pull in relevant context, generate Slides that are based on information directly from your own briefs or reports, and so much more.</p><p>Understanding what makes an effective prompt and learning to craft prompts on the fly can boost your productivity and creativity. Gemini for Workspace can help you:</p><ul><li><p>Improve your writing</p></li><li><p>Organize data</p></li><li><p>Create original images</p></li><li><p>Summarize information and surface insights</p></li><li><p>Have better meetings with automatic note taking</p></li><li><p>Research unfamiliar topics easily</p></li><li><p>Spot trends, synthesize information, and identify business opportunities</p></li></ul><p>For 25 years, Google has built helpful, secure products that give users choice and control over their data. It’s a bedrock principle for us. This was the case back when we first launched Gmail in 2004, and it remains true in the era of generative AI. This means your data is your data and does not belong to Google. Your data stays in your Workspace environment. Your privacy is protected. Your content is never used for targeting ads or to train or improve Gemini or any other generative AI models.</p><h3 id="how-to-use-this-prompt-guide">How to use this prompt guide</h3><p>This guide introduces you to prompting with Gemini for Workspace. It includes strong prompt design examples to help you get started. Additionally, it covers scenarios for different personas, use cases, and potential prompts.</p><p>You will notice a variety of prompt styles. Some prompts have brackets, which indicate where you would fill in specific details or tag your own personal files by typing @file name. Other prompts are presented without variables highlighted to show you what a full prompt could look like. All of the prompts in this guide are meant to inspire you, but ultimately they will need to be customized to help you with your specific work.</p><p>To get started, use the role-specific suggested prompts as inspiration to help you unlock a new and powerful way of working.</p><h2 id="administrative-support">Administrative support</h2><p>As an administrative support professional, you are responsible for keeping teams on track. You’re required to stay organized and efficient — even under pressure — while juggling many priority tasks.</p><p>This section provides you with simple ways to integrate prompts in your daily tasks.</p><h3 id="getting-started">Getting started</h3><p>First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of this guide.</p><p>Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write follow-up prompts to build on the initial generated response.</p><h3 id="prompt-iteration-example">Prompt iteration example</h3><h5 id="new-use-case-plan-agendas-offsite-meetings-and-more"><strong>NEW</strong> Use case: Plan agendas (offsite, meetings, and more)</h5><p>You&#x27;re planning a three-day offsite meeting. To build an agenda, you brainstorm with Gemini Advanced.<br/>You type:</p><blockquote>
<span style="background-color:#d0e0f0">I am an executive administrator to a team director.</span><span style="background-color:#f0d0d0">Our newly formed team now consists of content marketers, digital marketers, and product marketers. We are gathering for the first time at a three-day offsite in Washington, DC.</span><span style="background-color:#fff0c0">Plan activities for each day that include team bonding activities and time for deeper strategic work.</span><span style="background-color:#e0f0e0">Create a sample agenda for me. </span> </blockquote>
<ul><li><span style="background-color:#d0e0f0">Persona</span></li><li><span style="background-color:#f0d0d0">Task</span></li><li><span style="background-color:#fff0c0">Context</span></li><li><span style="background-color:#e0f0e0">Format</span></li></ul><p>This is a helpful start to your planning. You need to generate specific ideas for the team bonding activities.</p><p>You type:</p><blockquote><span style="background-color:#d0e0f0">Suggest three different icebreaker activities</span><span style="background-color:#fff0c0">that encourage people to learn about their teammates’ preferred working styles, strengths, and goals. Make sure the icebreaker ideas are engaging and can be completed by a group of 25 people in 30 minutes or less.</span></blockquote>
<p>You are happy with the agenda as a starting point. You now want to reformat Gemini’s response into a table.<br/>You type:</p><blockquote><span style="background-color:#f0d0d0">Organize this agenda </span><span style="background-color:#fff0c0">in a table format. </span><span style="background-color:#f0d0d0">Include one of your suggested icebreakers for each day.</span> </blockquote>
<p>You select <strong>Export to Docs</strong>. You open the newly created Doc. Now, you want to bring in detailed summaries for the strategy sessions using your existing files in Google Drive to provide more context for what will be discussed. You prompt Gemini in Docs and tag your relevant files by typing @file name.</p><blockquote><span style="background-color:#fff0c0">Use @[2024 H2 Team Vision] </span><span style="background-color:#f0d0d0">to generate a summary for the opening remarks on Day 1 of this agenda.  </span></blockquote>
<h3 id="example-use-cases">Example use cases</h3><h4 id="executive-administrators-and-executive-business-partners">Executive administrators and executive business partners</h4><h5 id="new-use-case-manage-multiple-email-inboxes"><strong>NEW</strong> Use case: Manage multiple email inboxes</h5><p>After returning from vacation, you have many unread, unsorted emails. You prompt Gemini in the Gmail side panel. You type:</p><blockquote><p>Summarize emails from [manager] from the last week.</p></blockquote>
<p>Gemini returns short summaries of each message. To directly access a message, you click on <strong>Sources</strong> and see tiles that bring you to specific emails. You select the most important one. Once the email thread opens, you see that many messages were exchanged. You prompt Gemini in Gmail:</p><blockquote><p>Summarize this email thread and list all action items and deadlines.</p></blockquote>
<p>You owe a response to a question, which you believe is best answered by a document in your Drive. You prompt Gemini in the Gmail side panel. You type:</p><blockquote><p>Generate a response to this email and use @[file name] to describe how the [initiative] can complement the workflow outlined in [colleague’s name]’s message.</p></blockquote>
<p>Gemini in Gmail returns a suggested email that pulls directly from your own Doc. After reading it over, you select the <strong>Copy</strong> icon in the side panel and paste it directly into your message.</p><h5 id="new-use-case-plan-business-travel"><strong>NEW</strong> Use case: Plan business travel</h5><p>Your manager has an upcoming meeting that is out of town. You are responsible for booking travel arrangements and creating a personalized itinerary. You need to research places to eat. You brainstorm with Gemini Advanced. You type:</p><blockquote><p>I am an executive assistant. I need to create an itinerary for a two-day business trip in [location] during [dates]. My manager is staying at [hotel]. Suggest different options for breakfast and dinner within a 10-minute walk of the hotel, and find one entertainment option such as a movie theater, a local art show, or a popular tourist attraction. Put it in a table for me.</p></blockquote>
<p>You continue your conversation until you are happy with the itinerary. Before you make reservations, you want to share the draft with your manager. You select <strong>Share &amp; export</strong> and select <strong>Draft in Gmail</strong>. Once the drafted email is created, you put the final touches on the message and send.</p><h5 id="new-use-case-track-travel-and-entertainment-budget"><strong>NEW</strong> Use case: Track travel and entertainment budget</h5><p>You want to create a spreadsheet to keep track of all of the travel expenses incurred. You open a new Google Sheet and prompt Gemini in the Sheets side panel. You type:</p><blockquote><p>Create a budget tracker for business travel. It should include columns for: date, expense type (meal, entertainment, transportation), vendor name, and a description.</p></blockquote>
<p>Gemini returns a tracker that is now ready for you to enter data.</p><h2 id="communications">Communications</h2><p>As a communications professional, you are responsible for ensuring your business is well understood by the public. You have to stay up to date with the trends, communicate clearly and effectively with many stakeholders, and build compelling narratives.</p><p>This section provides you with simple ways to integrate prompts in your daily tasks.</p><h3 id="getting-started">Getting started</h3><p>First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of this guide.</p><p>Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write follow-up prompts to build on the initial generated response.</p><h3 id="prompt-iteration-example">Prompt iteration example</h3><h5 id="new-use-case-create-a-press-release"><strong>NEW</strong> Use case: Create a press release</h5><p>You are in charge of public relations at a company in the personal care industry. The company you work for has just acquired a smaller brand, and you need to craft a press release. You’ve completed interviews with your company’s CEO, CFO, and the acquired company’s CEO. You’ve stored all of the most important quotes in one Doc. You also have a Doc with all of the information about the acquired brand, its vision, how it got started, and stats. You open a new Doc and prompt Gemini in the Docs side panel and type @file name to reference your relevant files. You type:</p><blockquote><span style="background-color:#d0e0f0">I&#x27;m a PR manager.</span><span style="background-color:#f0d0d0">I need to create a press release with a catchy title.</span><span style="background-color:#fff0c0">Include quotes from</span><span style="background-color:#e0f0e0">@[VIP Quotes Acquisition].</span> </blockquote>
<ul><li><span style="background-color:#d0e0f0">Persona</span></li><li><span style="background-color:#f0d0d0">Task</span></li><li><span style="background-color:#fff0c0">Context</span></li><li><span style="background-color:#e0f0e0">Format</span></li></ul><p>[Gemini returns a response]</p><p>Now you have a starting place for the press release, but you want to include more details about the brand that is being acquired and its founder. This information is stored in your Drive in another file. In the press release Doc, you prompt Gemini in the Docs side panel. You type:</p><blockquote><span style="background-color:#d0e0f0">Use @[Biography and Mission Statement] </span><span style="background-color:#f0d0d0">to add more information about the company that is being acquired, its mission, and how it got started. </span></blockquote>
<p>The generated paragraphs are a good starting place, so you select <strong>Insert</strong> to add them into your draft, and you begin making edits to the press release.</p><h3 id="example-use-cases">Example use cases</h3><h4 id="analyst-and-public-relations">Analyst and public relations</h4><h5 id="new-use-case-prepare-for-analyst-or-press-briefings"><strong>NEW</strong> Use case: Prepare for analyst or press briefings</h5><p>You need to create a brief to prepare a spokesperson for an upcoming meeting with analysts and the media for a new product launch. You open a new Doc and prompt Gemini in the Docs side panel. You type:</p><blockquote><p>Generate a brief template to prepare [spokesperson] for an upcoming media and analyst briefing for @[Product Launch]. Include space for a synopsis, key messages, and supporting data.</p></blockquote>
<p>This gives you a starting point to pull in additional information from your files. You prompt Gemini in the Docs side panel and tag your relevant files by typing @file name. You type:</p><blockquote><p>Craft a synopsis of the product launch in three main points using @[Product Launch - Notes].</p></blockquote>
<p>You click <strong>Insert</strong> before repeating the process to fill out the rest of the briefing document. Next, you need to create a spreadsheet of media and analyst contacts. You open a new Google Sheet and prompt Gemini in the Sheets side panel. You type:</p><blockquote><p>Organize my media and analyst contacts from @[Analyst and Journalist Contact Notes] for a new product briefing. I need to keep track of their names, type of contact (analyst or journalist), focus area, the name of the outlet, agency or firm that they work for, and a place where I can indicate the priority level of their attendance at this briefing (low, medium, high).</p></blockquote>
<p>Gemini in Sheets returns a spreadsheet, and you can go through and indicate priority level for each contact. Next, you want to create a slideshow to use during the briefing. You open a new Google Slide and prompt Gemini in the Slides side panel. You tag relevant files by typing @file name in the prompt. You type:</p><blockquote><p>Create a slide describing what [product] is from @[Product Launch - Notes]. Make sure it is short and easily understood by a broad audience.</p></blockquote>
<p>Gemini returns a Slide. You continue to build your presentation by using this method to generate additional Slides.</p><h5 id="new-use-case-create-mock-interview-questions-to-prepare-spokespeople"><strong>NEW</strong> Use case: Create mock interview questions to prepare spokespeople</h5><p>Now, you need to prepare your company&#x27;s spokesperson for interviews that will follow the briefing. To generate a list of mock interview questions, you decide to chat with Gemini Advanced. You type:</p><blockquote><p>I am a [PR/AR] manager at [company name]. We just launched [product] and had a briefing where we discussed [key messages]. I am preparing [spokesperson and role/title] for interviews. Generate a list of mock interview questions to help [spokesperson] prepare. Include a mixture of easy and hard questions, with some asking about the basics of [product] and some asking about the long-term vision of [product].</p></blockquote>
<p>Gemini returns a list of questions that can help you prepare your company&#x27;s spokesperson. You refine the suggested questions by continuing the conversation with Gemini. Then you select <strong>Share &amp; export</strong> and <strong>Export to Docs</strong>. You open the newly created Doc, prompt Gemini in the Docs side panel, and tag relevant files by typing @file name. You type:</p><blockquote><p>Use @[Product Launch Notes] to write suggested answers for these questions. Write the talking points as if you are [title of spokesperson] at [company].</p></blockquote>
<p>Gemini in Docs returns suggested talking points, and you select Insert to add them into your draft. Now you&#x27;re ready to continue tweaking the interview prep for your spokesperson.</p><h4 id="communications-manager">Communications manager</h4><h5 id="new-use-case-craft-internal-communications"><strong>NEW</strong> Use case: Craft internal communications</h5><p>Your company has redesigned its intranet to be more user friendly. You’re in charge of internal communications for the launch. You want help drafting this message. You open a new Google Doc and prompt Gemini in the Docs side panel. You type:</p><blockquote><p>I need to draft a company-wide memo unveiling our relaunched intranet. The [new page] addresses [common feedback we heard from employees] and aims to create a more user friendly experience. Draft an upbeat memo announcing [the new site] using @[Intranet Launch Plan Notes].</p></blockquote>
<p>Gemini in Docs returns a drafted memo. You refine and edit the text to be exactly as you need it.</p><h2 id="customer-service">Customer service</h2><p>As a customer service professional, you strive to deliver service that’s effortlessly efficient, consistently delightful, and powered by a proactive, helpful team. This section provides you with simple ways to integrate prompts in your daily tasks.</p><h3 id="getting-started">Getting started</h3><p>First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of this guide.</p><p>Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write follow-up prompts to build on the initial generated response.</p><h3 id="prompt-iteration-example">Prompt iteration example</h3><h5 id="use-case-draft-customer-communications">Use case: Draft customer communications</h5><p>You&#x27;re a customer service representative, and you&#x27;re responsible for responding directly to customer inquiries and concerns. You just received an email from a customer who received damaged goods. You open a new Google Doc and click on <strong>Help me write</strong> to prompt Gemini in Docs. Type the following:</p><blockquote><span style="background-color:#f0d0d0">Help me craft an empathetic email response.</span><span style="background-color:#d0e0f0">I am a customer service representative, </span><span style="background-color:#f0d0d0">and I need to create a response to a customer complaint.</span><span style="background-color:#fff0c0">The customer ordered a pair of headphones that arrived damaged. They’ve already contacted us via email and provided pictures of the damage. I’ve offered a replacement, but they’re requesting an expedited shipping option that isn’t typically included with their order.</span><span style="background-color:#e0f0e0">Include a paragraph that acknowledges their frustration and three bullet points with potential resolutions.</span></blockquote>
<ul><li><span style="background-color:#d0e0f0">Persona</span></li><li><span style="background-color:#f0d0d0">Task</span></li><li><span style="background-color:#fff0c0">Context</span></li><li><span style="background-color:#e0f0e0">Format</span></li></ul><p>You like the email that Gemini in Docs created so you select Insert. But you want to brainstorm ways to resolve
the issue without offering expedited shipping. You prompt by selecting Help me write. You type:</p><blockquote><span style="background-color:#f0d0d0">Suggest 10 alternative options </span><span style="background-color:#fff0c0">in place of expedited shipping to resolve the customer’s frustration about receiving the damaged package.</span></blockquote>
<h3 id="example-use-cases">Example use cases</h3><h4 id="customer-service-manager-or-representative">Customer Service Manager or Representative</h4><h5 id="new-use-case-respond-to-complex-customer-issues-using-faq-documents"><strong>NEW</strong> Use case: Respond to complex customer issues using FAQ documents</h5><p>A customer has reached out with a multi-part, complex question. You need to find and use information that is spread across multiple documents in order to respond accurately. You prompt Gemini in the Drive side panel.</p><p>You type:</p><blockquote><p>Summarize information about [product name] including the product’s specific [return policy], [ingredients], and [certifications].</p></blockquote>
<p>Gemini returns a summary and links to relevant files, which you can directly click into from the side panel. You read the information before returning to your email to generate a response to the customer. You open the message and prompt Gemini in the Gmail side panel and tag relevant files by typing @file name. You type:</p><blockquote><p>Generate a response to the customer question about our [return policy] and [product certifications] based on @[Customer FAQ Document]. Use a helpful and professional tone.</p></blockquote>
<h5 id="use-case-standardize-communication-frameworks">Use case: Standardize communication frameworks</h5><p>You&#x27;re a customer service team manager. You need to create scalable resources to standardize your team&#x27;s communications. You open a new Google Doc. You brainstorm by prompting Gemini in the Docs side panel. You type:</p><blockquote><p>Draft templates for three different types of customer communication. Create templates for apology emails, order confirmation messages, and thank you notes for loyal customers. Keep each template to one paragraph and use a friendly tone.</p></blockquote>
<p>The suggested templates offer a starting point for you to begin editing and personalizing with elements consistent with your company’s brand and policies. Now you want to outline your team’s communication best practices for onboarding. You open a new Doc and prompt Gemini in Docs. You type:</p><blockquote><p>Craft a list of customer communication best practices that can be used to train new team members. Outline three sections, including how to handle happy customer inquiries, neutral customer inquiries, and dissatisfied customer inquiries.</p></blockquote>
<p>You also want to support the team with standardized language that they can use when interacting with customers on phone calls. You prompt Gemini Advanced:</p><blockquote><p>I am a [customer service manager]. I am trying to create standardized language that the team can use when interacting with customers on phone calls. Generate templates for common call openings, greetings, and closures for a customer service representative at a retail store. These templates should allow for personalization with customer details. The goal is to ensure consistency and professionalism while allowing for differentiation with specific customer information.</p></blockquote>
<h5 id="use-case-improve-customer-service">Use case: Improve customer service</h5><p>You&#x27;ve noticed an uptick in customer complaints. You need to collaborate across departments to address recurring issues. You prompt Gemini in Gmail. You type:</p><blockquote><p>Draft an email to my colleagues proposing a meeting to discuss customer experience improvement initiatives. Request that marketing, sales, and product stakeholders meet in the next week to get a clear sense of roles and responsibilities.</p></blockquote>
<p>You edit the email and send it to your colleagues. Now you want to create a spreadsheet that you can use to track progress on this cross-departmental initiative. You open a Google Sheet and prompt Gemini in the Sheets side panel. You type:</p><blockquote><p>Create a table to track the progress and impact of different customer experience improvement tactics using relevant metrics, including support ticket volume and priority level (high, medium, low).</p></blockquote>
<h4 id="customer-support-specialist">Customer Support Specialist</h4><h5 id="new-use-case-analyze-customer-feedback"><strong>NEW</strong> Use case: Analyze customer feedback</h5><p>You have a spreadsheet that tracks customer feedback. You want to analyze it and brainstorm potential reasons for the trends. You chat with Gemini Advanced. You upload the file and type:</p><blockquote><p>I am a customer support specialist. Using the attached spreadsheet, identify trends and patterns in our [customer feedback] by [category] over [time period]. Identify areas where [customer outreach] has increased significantly and investigate potential reasons.</p></blockquote>
<h5 id="use-case-enable-customer-self-service">Use case: Enable customer self-service</h5><p>Customer feedback has consistently said your return policy guidelines are unclear. You open a Doc that states the return, refund, and store credit policies. You prompt Gemini in Docs by selecting <em>Help me write</em>. You type:</p><blockquote><p>Summarize this content to write a clear and concise product return policy and outline 5 steps for customers to take in sequential order.</p></blockquote>
<p>You like how simple the steps are. You repeat the process for your refund policy and store credit policy. Now, you want to use the newly simplified content to create a blog post for customers. Using your Google Doc with the newly written guidance, you prompt Gemini in Google Docs. You type:</p><blockquote><p>Take this content and turn it into a short blog with the title “Resolve Common Issues Without Agent Assistance.” Have separate sections for our return policy, our refund policy, and our store credit policy.</p></blockquote>
<p>Now you want to create an email template that the team can use when they receive customer questions around these three areas. You open a new Google Doc and prompt Gemini in Docs using <strong>Help me write</strong>. You type:</p><blockquote><p>Draft an email template to a customer that highlights self-service resources referencing [blog link] for [support issues]. Thank the customer for their business and assure them of our commitment to meeting their needs.</p></blockquote>
<h5 id="use-case-conduct-voice-of-the-customer-research">Use case: Conduct voice of the customer research</h5><p>You want to email a dissatisfied customer to attempt to make things right. You open an email that includes a customer complaint. You prompt Gemini in Gmail by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Request a follow-up conversation on [date] at [time] with this customer who provided negative feedback to understand their concern and offer resolutions. Include example solutions.</p></blockquote>
<p>The drafted response is a nice start, but you want to refine the language. You iterate by prompting Gemini in Gmail using <strong>Refine</strong> and <strong>Elaborate</strong>. Next, you want to create a short survey that you can send after each follow-up customer call. You open a new Google Doc and prompt Gemini in Docs. You type:</p><blockquote><p>Create five different questions to customers who have just spoken to an agent on the phone. Questions should gauge how effective the call was, if the customer’s concern was addressed, and if they would recommend our business to others.</p></blockquote>
<h2 id="executives">Executives</h2><p>As an executive, your time is incredibly constrained. Every decision you make can impact growth, innovation, and the trajectory of your business. Understanding your market and making informed, strategic decisions is paramount, and so is getting urgent tasks done while you’re on the go.</p><p>This section provides you with simple ways to integrate prompts in your daily tasks.</p><h3 id="getting-started">Getting started</h3><p>First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of this guide.</p><p>Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write follow-up prompts to build on the initial generated response.</p><h3 id="prompt-iteration-example">Prompt iteration example</h3><h5 id="use-case-communicate-on-the-go">Use case: Communicate on the go</h5><p>You are an executive about to board a long flight, and you just received an invitation for the next board meeting with an agenda. You have a couple of comments, and you want to propose adding a few topics to the agenda. You open Gmail, and you prompt Gemini in Gmail. You type:</p><blockquote><span style="background-color:#f0d0d0">Draft an email</span><span style="background-color:#fff0c0">confirming that I will be at the board meeting.</span><span style="background-color:#f0d0d0">Ask if we can adjust the agenda to give 15 minutes to [urgent topics].</span></blockquote>
<ul><li><span style="background-color:#d0e0f0">Persona</span></li><li><span style="background-color:#f0d0d0">Task</span></li><li><span style="background-color:#fff0c0">Context</span></li><li><span style="background-color:#e0f0e0">Format</span></li></ul><p>Gemini in Gmail: [Drafts an email]</p><p>The email looks good, but you want to make sure the tone is as formal as possible. You select <strong>Refine</strong> and <strong>Formalize</strong>.</p><p>Gemini in Gmail: [Formalizes tone]</p><p>You read the email and select Insert. Before sending it, you make a light edit to thank the team for keeping you on track while traveling.</p><h3 id="example-use-cases">Example use cases</h3><h4 id="chief-executive-officer">Chief Executive Officer</h4><h5 id="new-use-case-enhance-personal-productivity-and-time-management"><strong>NEW</strong> Use case: Enhance personal productivity and time management</h5><p>You have important email threads that have numerous responses. You need to quickly catch up. You open the message in Gmail and read the automatically generated summary from Gemini in the Gmail side panel. To respond, you prompt Gemini in the Gmail side panel and tag relevant files by typing @file name. You type:</p><blockquote><p>Generate a response to [person] about [topic]. Include details on [deliverable] and [timeline] using @[Project A Status Report].</p></blockquote>
<h5 id="new-use-case-create-outlines-of-presentations-in-seconds"><strong>NEW</strong> Use case: Create outlines of presentations in seconds</h5><p>Your team will pull together a presentation for you, and you want to provide an outline to get them started. You want to generate an outline using Gemini Advanced. You select the microphone icon and use your voice to prompt. You say:</p><blockquote><p>I&#x27;m the CEO giving a presentation to [audience] at [event], and I want to create a detailed outline for my team to get started. I want to include a few important topics, including [areas of focus] and how our company is innovating with [company initiatives]. I&#x27;m envisioning time for a customer Q&amp;A to end the presentation. Include suggested questions we could ask of a customer from the [industry] industry about how they are using our [product] to achieve [business outcome].</p></blockquote>
<h4 id="chief-operating-officer">Chief Operating Officer</h4><h5 id="use-case-prepare-challenging-employee-communications">Use case: Prepare challenging employee communications</h5><p>You&#x27;re hosting a quarterly town hall meeting with the entire company. You want to write uplifting remarks to open the meeting. You open a new Doc and prompt Gemini in the Docs side panel. You type:</p><blockquote><p>Write two uplifting paragraphs for employees who have just finished a challenging quarter. Acknowledge [difficulties] and emphasize [positives] for the upcoming quarter. Use a tone that is motivating, optimistic, and fosters a sense of unity and collaboration.</p></blockquote>
<p>You want to brainstorm and practice how you will respond empathetically to potentially tough questions. You go to Gemini Advanced and type:</p><blockquote><p>I&#x27;m the COO of a mid-sized company. I am hosting a quarterly town hall meeting with the entire company. I want to brainstorm and practice how I will respond to potentially tough questions. Help me write challenging questions that employees may ask at the upcoming town hall about [URL of company announcement]. Generate potential answers for each question that use a confident but firm tone. The responses should acknowledge the concern and let the employees know that we are striving to do our best for the entire company.</p></blockquote>
<h5 id="use-case-streamline-responses-on-the-go">Use case: Streamline responses on the go</h5><p>Your plans have changed, and you can&#x27;t attend a meeting. You need to provide the team with answers on a few key items. You open Gmail and use a voice command to prompt Gemini in Gmail. You say:</p><blockquote><p>Draft an email to [project lead] letting them know I will not be in the meeting due to an urgent matter. Ask them to take detailed notes and to ensure the team arrives at a decision on [key topic] in addition to assigning ownership of the postmortem report to [colleague].</p></blockquote>
<p>Chief Marketing Officer</p><h5 id="new-use-case-perform-market-research-and-campaign-planning"><strong>NEW</strong> Use case: Perform market research and campaign planning</h5><p>You&#x27;re starting annual planning. You want to conduct research on your target audience. You chat with Gemini Advanced. You type:</p><blockquote><p>I&#x27;m a marketing leader conducting analysis in preparation for next year&#x27;s [launch]. Define my target audiences [audiences], for my new line of [product]. Include interests, relevant marketing channels, and top trends that drive their consideration and purchase behavior.</p></blockquote>
<p>Next, you export your findings to a Doc by selecting <strong>Share &amp; export</strong> and <strong>Export to Docs</strong>. Now, you want to pull in relevant data from your own files by typing <code>@file name</code>. You prompt Gemini in the Docs side panel. You type:</p><blockquote><p>Brainstorm value props for my [target audiences] based on features from @[Product Requirements Document]. Include a section on campaign learnings from @[Campaign Performance].</p></blockquote>
<h5 id="use-case-brainstorm-content-and-thought-leadership">Use case: Brainstorm content and thought leadership</h5><p>You finished a meeting with your social media team leads. You took notes in a Doc about what resonates with your audience, trending topics, target audience data, and keywords that are effective in driving engagement with your brand. You want to brainstorm potential thought leadership pieces using these insights. You prompt Gemini in the Docs side panel. You type:</p><blockquote><p>Generate a list of four relevant and engaging thought leadership blog post ideas for [company] based on trending topics, target audience analysis, and brand keywords.</p></blockquote>
<p>During the same conversation, the team discussed launching a new brand campaign. You know that your customers value your reliable and unique services, and your company has a long history of delivering for customers. You need help getting started with ideas on a new campaign tagline. You open a new Google Doc and select Help me write. You type:</p><blockquote><p>Generate three options for a new slogan emphasizing reliability, innovation, and a long history of popularity for [company].</p></blockquote>
<p>The slogans help you get started with the creative process. You have upcoming events that could be the perfect place to test elements of a new campaign. You want to mock up ideas for booth graphics for your events team. You open a new presentation in Google Slides and select <strong>Create image with Gemini</strong>. You type:</p><blockquote><p>Create an image of a trade show booth using orange and blue colors. The booth should be modern and showcase interactive computer stations.</p></blockquote>
<h5 id="use-case-conduct-competitive-analysis">Use case: Conduct competitive analysis</h5><p>Your team is considering expanding into a new line of business. To research, you go to Gemini Advanced, and you type:</p><blockquote><p>I am a CMO conducting a competitive analysis. My company is considering expanding into [a new line of business]. Generate a list of the top five competitors in the [industry] industry and include their pricing, strengths, weaknesses, and target audience.</p></blockquote>
<p>After going deeper in your research, you decide to create a five-year strategy to see what this could look like for the company. You type:</p><blockquote><p>Okay, I am going to try to convince my CEO that we should expand into [line of business]. Draft a concise, competitive strategy outline for the next five years for the [industry] industry across North America markets with potential goals, strategies, and tactics.</p></blockquote>
<p>After iterating to generate an appropriate outline, you fill in additional details and thoughts to make the document your own.</p><h4 id="chief-technology-officer">Chief Technology Officer</h4><h5 id="use-case-summarize-emerging-technology-trends">Use case: Summarize emerging technology trends</h5><p>You need to catch up on emerging technology trends as the landscape is shifting quickly. You open Gemini Advanced, and you type:</p><blockquote><p>I am the CTO of [company] in [industry]. I want to understand emerging technology trends. Summarize the top five emerging technologies with the most significant potential impact on [industry]. For each technology, list its potential benefits and challenges, and suggest how it could impact [company] in the next two to three years.</p></blockquote>
<p>You want to dig deeper on specific topics, so you continue the conversation by typing:</p><blockquote><p>Recommend three areas where [my company] can take proactive steps to stay ahead of the curve on [specific areas].</p></blockquote>
<h4 id="chief-information-officer">Chief Information Officer</h4><h5 id="new-use-case-communicate-technical-topics-to-non-technical-audiences"><strong>NEW</strong> Use case: Communicate technical topics to non-technical audiences</h5><p>You&#x27;re making the case to digitally transform your company by adopting generative AI solutions. You need to present to the CEO and other leadership. You want help in communicating technical topics to non-technical audiences. You chat with Gemini Advanced. You type:</p><blockquote><p>I am the CIO at [company], and I am trying to build the case to [adopt generative AI solutions]. I need to explain the technical concept of generative AI to a non-technical audience (the CEO and board). Help me write talking points that will help me convey what generative AI is, ways it could help us digitally transform, and why it’s important to our growth as a company. Include details about how it could potentially refocus our technical talent on more strategic work, help enhance our workforce’s productivity, and help us better serve our global workforce and customers.</p></blockquote>
<p>Gemini provides suggested ways to discuss the topic. You continue your brainstorm and then export your conversation by clicking <strong>Share &amp; export</strong> and <strong>Export to Docs</strong>. Then, to build a presentation, you open a new Google Slide and prompt Gemini in the Slides side panel and tag relevant files by typing @file name. You type:</p><blockquote><p>I need to build a presentation to explain a technical topic to a non-technical audience. Generate an [introduction slide] that [describes what generative AI is] using @[Gen AI Explanation Notes].</p></blockquote>
<p>You continue to use the same prompt, adjusting the topic to generate more slides for your presentation based on your notes.</p><h5 id="new-use-case-research-vendor-products-services-and-features"><strong>NEW</strong> Use case: Research vendor products, services, and features</h5><p>You&#x27;re working on a report to make a vendor recommendation. You visit Gemini Advanced and type:</p><blockquote><p>I am the CIO at [company]. We are currently evaluating vendor options to [replatform our intranet]. Right now, we use [vendor], but we are looking to switch because [we are unhappy with limited functionality and account support]. Suggest additional vendor options to consider and include descriptions of their product and services and key features.</p></blockquote>
<h5 id="use-case-develop-technical-summaries">Use case: Develop technical summaries</h5><p>Your team just provided a lengthy technical report. You need to summarize it for your CEO. You open the Google Doc with the full report, and you prompt Gemini in the Docs side panel. You type:</p><blockquote><p>Summarize the key findings and implications of this report for [audience]. Focus on the main [vulnerabilities] identified and the recommended actions to address them. Use a formal tone.
You make light edits to the summary and include it as an executive summary.</p></blockquote>
<h5 id="use-case-track-it-assets">Use case: Track IT assets</h5><p>Your company needs a quick way to track software access for new hires. You open a new Google Sheet and prompt Gemini in the Sheets side panel. You type:</p><blockquote><p>Create a tracker of software licenses for employees and include columns for license types, usage rights, and renewal dates.</p></blockquote>
<h4 id="chief-human-resources-officer">Chief Human Resources Officer</h4><h5 id="use-case-demonstrate-employee-appreciation">Use case: Demonstrate employee appreciation</h5><p>You want to set up a new program to help everyone feel included, appreciated, and acknowledged across the organization. To brainstorm, you open a new Google Doc and prompt Gemini in the Docs side panel. You type:</p><blockquote><p>Brainstorm 10 employee appreciation ideas based on diverse employee interests such as cooking, gardening, sports, reading, and traveling.</p></blockquote>
<p>Gemini in Docs kick-starts your creativity, and now you have ideas for employee interest clubs and events. You also want to ensure your leadership team is regularly encouraging managers to recognize talent on their teams, so you create email templates they can use as inspiration. You prompt Gemini in Docs by selecting <strong>Help me write</strong>, and you type:</p><blockquote><p>Draft an email template that thanks [employee] for their hard work and [recent accomplishments]. Offer them an extra perk for their dedication, such as [a coffee gift card]. Use an upbeat and professional tone.</p></blockquote>
<h5 id="use-case-assess-employee-satisfaction">Use case: Assess employee satisfaction</h5><p>You want to draft an anonymous survey that allows people to openly and honestly assess how they are feeling. To draft questions, you open a new Google Doc and prompt Gemini in the Docs side panel. You type:</p><blockquote><p>Draft an anonymous employee satisfaction survey with questions and answer options that touch upon key areas like workload, work-life balance, compensation, and career growth opportunities. Ensure the questions are clear, concise, and avoid leading answers.</p></blockquote>
<p>You received feedback from 15 senior leaders, and you’ve gathered all of the anonymous results in a Doc.<br/>You want to create a summary that you can use in your next call. You prompt Gemini in the Docs side panel.<br/>You type:</p><blockquote><p>Summarize the results of the employee feedback to identify key themes.</p></blockquote>
<h2 id="frontline-management">Frontline management</h2><p>As a frontline worker manager, your team’s work is indispensable to your organization — your team may not primarily complete its day’s work on a computer, but communication and collaboration remains key.</p><p>This section provides you with simple ways to integrate prompts in your daily tasks.</p><h3 id="getting-started">Getting started</h3><p>First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of this guide.</p><p>Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write follow-up prompts to build on the initial generated response.</p><h3 id="prompt-iteration-example">Prompt iteration example</h3><h5 id="new-use-case-find-accurate-information-quickly"><strong>NEW</strong> Use case: Find accurate information quickly</h5><p>A customer just approached you with a question about an ongoing sale. You could use help navigating the numerous files you have access to so that you find the right information quickly. You prompt Gemini in the Drive side panel. You type:</p><blockquote><span style="background-color:#f0d0d0">Find the document</span><span style="background-color:#fff0c0">that details the [company name]&#x27;s [holiday] sale details. </span></blockquote>
<ul><li><span style="background-color:#d0e0f0">Persona</span></li><li><span style="background-color:#f0d0d0">Task</span></li><li><span style="background-color:#fff0c0">Context</span></li><li><span style="background-color:#e0f0e0">Format</span></li></ul><p>Gemini in Drive returns suggested relevant files. From the side panel, you can directly summarize the files or you can click into a specific document. You open a suggested Doc to help answer the question. You prompt Gemini in the Docs side panel. You type:</p><blockquote><span style="background-color:#f0d0d0">How much can customers save on [product type] during this sale? </span></blockquote>
<p>Gemini returns a response, which helps you answer your customer&#x27;s question in a timely manner.</p><h3 id="example-use-cases">Example use cases</h3><h4 id="retail-associate">Retail associate</h4><h5 id="new-use-case-improve-team-collaboration-by-finding-and-sharing-information-easily"><strong>NEW</strong> Use case: Improve team collaboration by finding and sharing information easily</h5><p>Your store recently updated its return and exchange policies. To find the information, you prompt Gemini in the Drive side panel. You type:</p><blockquote><p>Find the document that discusses our new return and exchange policies.</p></blockquote>
<p>Gemini returns suggested files that are related to the new policies. You directly click into the relevant file. Now, you want to send an email summarizing the document for your colleagues’ future reference. You open your email and prompt Gemini in the Gmail side panel. You type:</p><blockquote><p>Write an email to my new colleagues summarizing @[Updated Return and Exchange Policy H2 2024].</p></blockquote>
<p>You select <strong>Insert</strong> and further personalize the message before sending it.</p><h5 id="new-use-case-streamline-task-management"><strong>NEW</strong> Use case: Streamline task management</h5><p>You have a list of opening and closing duties that you must perform depending on what shift you are working. You want to keep yourself organized, so you create a tracker using the duties listed in your onboarding Doc. You open a new Google Sheet and prompt Gemini in the Sheets side panel and tag relevant files by typing @file name. You type:</p><blockquote><p>I am a retail manager and I need to create a checklist for my opening and closing duties. Create a template with columns for [opening and closing duties] from @[Onboarding New Hire Information].</p></blockquote>
<p>Gemini creates a spreadsheet. As you go through your day, you mark different tasks as complete. You have to leave your shift early, but you first need to communicate to the rest of the team what still needs to be done. You open your Gmail and prompt Gemini in the Gmail side panel and tag the spreadsheet you just created. You type:</p><blockquote><p>Write an email to the team telling them what still needs to be done from the AM shift from @[Opening and Closing Duties Tracker].</p></blockquote>
<h4 id="warehouse-worker">Warehouse worker</h4><h5 id="new-use-case-manage-inventory"><strong>NEW</strong> Use case: Manage inventory</h5><p>A customer wants to place a bulk order. You need to check the store&#x27;s inventory to see if you have enough to fulfill it. You open your inventory spreadsheet that tracks this information and prompt Gemini in the Sheets side panel. You type:</p><blockquote><p>How many [units] of [product] do we have left in our inventory?</p></blockquote>
<h5 id="new-use-case-manage-audits"><strong>NEW</strong> Use case: Manage audits</h5><p>Your warehouse is undergoing an inventory audit, and you’re in charge of verifying any numbers that are misaligned between your inventory tracker product total and what was counted during the audit. You prompt Gemini in the Sheets side panel. You type:</p><blockquote><p>Create a formula that helps me calculate the difference between two columns. Which items have a discrepancy in [the total number counted] versus [the quantity on hand]?</p></blockquote>
<p>You verify Gemini’s response that there are only a few items whose count did not align to your inventory tracker’s total. You need to write a message to your supervisor telling them that you’re looking into the issue. You open your Gmail and prompt Gemini in the Gmail side panel. You type:</p><blockquote><p>I&#x27;m a warehouse worker managing an audit. Write a message to my supervisor to let them know that I am looking into the products whose counts are incorrect.</p></blockquote>
<p>The drafted email looks good to go, so you hit send after reviewing.</p><h2 id="human-resources">Human resources</h2><p>As an HR professional, you&#x27;re the backbone of your organization, and you deal with a large volume of confidential and sensitive information. You shape company culture, find and nurture talent, and ensure a positive employee experience. These are no small feats.</p><p>This section provides you with simple ways to integrate prompts in your day-to-day tasks.</p><h3 id="getting-started">Getting started</h3><p>First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of this guide.</p><p>Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write follow-up prompts to build on the initial generated response.</p><h3 id="prompt-iteration-example">Prompt iteration example</h3><h5 id="use-case-welcome-new-employees">Use case: Welcome new employees</h5><p>You&#x27;re an HR manager working on a presentation script. You have a Google Doc full of notes, bullet points, and topics that you would like to cover. You begin by opening your Google Doc with notes, and you prompt Gemini in Docs.</p><blockquote><span style="background-color:#d0e0f0">I am an HR manager,</span><span style="background-color:#fff0c0">and I am developing a script for my presentation for new hires.</span><span style="background-color:#f0d0d0">I need to create the script for an onboarding presentation about our company’s commitment to employee development and well-being.</span><span style="background-color:#e0f0e0">Help me draft talking points that showcase why employee mentorship and development are core values for our company using @[Mission Statement and Core Values]. </span></blockquote>
<ul><li><span style="background-color:#d0e0f0">Persona</span></li><li><span style="background-color:#f0d0d0">Task</span></li><li><span style="background-color:#fff0c0">Context</span></li><li><span style="background-color:#e0f0e0">Format</span></li></ul><p>Gemini in Docs: [Drafts talking points]</p><p>You select <strong>Insert</strong>. Now, you want to add more targeted talking points. You type:</p><blockquote><span style="background-color:#f0d0d0">Add four talking points</span><span style="background-color:#fff0c0">for a new section of the presentation script that explains how we support our employees’ development.</span><span style="background-color:#f0d0d0">Mention our training and certification programs and mentorship opportunities using</span><span style="background-color:#fff0c0">@[Learning and Development Paths],</span><span style="background-color:#f0d0d0">and write a strong closing statement</span><span style="background-color:#fff0c0">about our expectation that everyone contributes to a respectful and welcoming workplace.</span><span style="background-color:#e0f0e0">Use a professional tone. </span></blockquote>
<p>Gemini in Docs: [Adds talking points]</p><p>You add in more details and then you’re ready to create a draft of the Google Slides that will accompany your talking points.</p><h3 id="example-use-cases">Example use cases</h3><h4 id="recruiter">Recruiter</h4><h5 id="new-use-case-report-on-recruitment-metrics"><strong>NEW</strong> Use case: Report on recruitment metrics</h5><p>The business is growing, and you have a large hiring effort underway. You want to see a holistic view of how your hiring efforts are going. You open your Google Sheet and prompt Gemini in the Sheets side panel. You type:</p><blockquote><p>Help me create a formula to calculate the total total number of [hires] by [department].</p></blockquote>
<p>You continue your conversation by prompting additional questions. You type:</p><blockquote><p>In what month did we hire the most people?</p></blockquote>
<p>You continue with your line of questions until you feel ready to write your report.</p><h5 id="use-case-manage-the-recruiting-process">Use case: Manage the recruiting process</h5><p>You want to brainstorm potential ways the company can better manage the recruiting process. You open the team’s Google Doc with recruiting strategies. You prompt Gemini in the Docs side panel. You type:</p><blockquote><p>Create a list of strategies our recruiters can use to improve our existing recruiting process and identify potential job candidates.</p></blockquote>
<p>After creating a short recommendation for leadership on how the team will improve existing recruiting processes, the team receives guidance for a job opening for a content marketing manager. You open a new Doc and prompt Gemini in Docs. You type:</p><blockquote><p>I am opening a new job position on the marketing team. Write a compelling role description for a content marketing manager. Highlight key responsibilities [insert] and requirements, including B2B and B2C content creation, a minimum of five years experience, and a portfolio of writing examples.</p></blockquote>
<h5 id="use-case-manage-the-interview-process">Use case: Manage the interview process</h5><p>You want to prepare questions for phone screen interviews. You decide to prepare by using Gemini Advanced.<br/>You upload the relevant file and type:</p><blockquote><p>I am a recruiter, and I am preparing for candidate interviews. Using the job description in the file I&#x27;m uploading, write a list of 20 open-ended interview questions that I can use to screen candidates.</p></blockquote>
<h5 id="use-case-communicate-with-candidates">Use case: Communicate with candidates</h5><p>The team has made its hiring decisions. You open the Google Doc with notes on each candidate. You prompt Gemini in Docs by selecting Help me write. You type:</p><blockquote><p>I am writing an email to a job candidate who just finished the interview process. Create a template for an offer letter for the [selected candidate] for the [position] with a request to schedule a call to discuss benefits, compensation, and start date.</p></blockquote>
<p>Now, you want to generate personalized, empathetic email copy to send to the job candidates who will not receive an offer. You prompt Gemini in Docs by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>I am writing an email to job candidates who finished the interview process, but who were not selected. Help me write a rejection letter for [candidate] for the [position]. Use an empathetic tone.</p></blockquote>
<h4 id="hr-manager">HR Manager</h4><h5 id="new-use-case-conduct-employee-engagement-and-satisfaction-surveys"><strong>NEW</strong> Use case: Conduct employee engagement and satisfaction surveys</h5><p>You are in charge of building a survey that will go out to all employees. You want to brainstorm ideas on questions to ask. You visit Gemini Advanced and type:</p><blockquote><p>I am an HR manager in charge of running our enterprise-wide survey at [company] to gauge employee engagement and satisfaction. Generate a list of questions I can use to build the survey.</p></blockquote>
<p>Your company has completed its annual employee engagement and satisfaction survey. Now, you want to clean up the data before you analyze it. You go to Gemini Advanced, upload the relevant file, and type:</p><blockquote><p>Help me clean my employee survey spreadsheet. Specifically, fill any blank values in the name column with “Anonymous,” and if the region column shows Headquarters, replace that with HQ. Finally, remove any rows where the satisfaction column is blank. Please generate a new file for me with my cleaned data.</p></blockquote>
<h5 id="new-use-case-create-individualized-learning-and-development-plans"><strong>NEW</strong> Use case: Create individualized learning and development plans</h5><p>You have all of your company&#x27;s learning resources stored in your Google Drive. For each new hire, you want to create a tailored learning and development plan. To do this, you prompt Gemini in the Drive side panel. You type:</p><blockquote><p>Create a personalized learning and development plan for a new hire who needs to learn about [topic].
Organize it by day and suggest relevant files.</p></blockquote>
<h5 id="use-case-onboard-employees">Use case: Onboard employees</h5><p>The recruiters have just filled the company’s two open roles. Now, you’re in charge of ensuring the candidates have a smooth onboarding experience. You need help in structuring information for the new hires, so you open a Google Sheet and prompt Gemini in the Sheets side panel. You type:</p><blockquote><p>Create a table that outlines a new employee&#x27;s first-week schedule, including key meetings, training sessions, and introductions. Provide a column for key contacts and priority level (low, medium, high) for each activity.</p></blockquote>
<p>Gemini in Sheets returns a formatted Google Sheet that you can now fill in with key contacts, meetings, and activities. The conditional formatting makes it easy for you to sort tasks by priority level with color-coded visual cues. Next, you need to create ways for the team to bond. You open a new Google Doc and prompt Gemini in the Docs side panel. You type:</p><blockquote><p>Design a team-bonding activity, such as an office scavenger hunt, to have team members work together during their team meeting.</p></blockquote>
<p>Gemini in Docs provides suggestions that help you brainstorm about the scavenger hunt. You tweak the outputs and get the idea approved by the team lead. Now, you need to communicate with the new hires about their first day when they will meet the team. You open Gmail and prompt Gemini in Gmail by selecting <strong>Help me write</strong>.
You type:</p><blockquote><p>Draft an email to the new employees on the [team] to meet the rest of their team and explain the team-building purposes of the meeting.</p></blockquote>
<h5 id="use-case-communicate-key-findings-and-draft-follow-up-surveys">Use case: Communicate key findings and draft follow-up surveys</h5><p>Now that you’ve finished onboarding new employees, you need to focus on ensuring that the latest company research data is easily understood by leadership. You’re committed to creating a welcoming environment for all employees where they can develop their skills. You open the Google Doc with the finalized report. You prompt Gemini in Docs by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Draft an email to senior leadership that summarizes the key findings from our [report]. Include a short introductory paragraph with bullet points on the most important findings.</p></blockquote>
<p>Gemini in Docs returns a summary with bullet points. You edit it and then use it to email the leadership team. As a follow-up action, you want to understand how changes made to company policies impact the employee experience. You open Gemini in Docs to begin drafting a survey. You select <strong>Help me write</strong> and type:</p><blockquote><p>Draft an anonymous employee survey with questions and answer options to monitor company progress on [topics].</p></blockquote>
<h2 id="marketing">Marketing</h2><p>As a marketing professional, you&#x27;re the creative force behind captivating campaigns, brand experiences, lead generation, and more. You understand the power of data-driven insights, compelling messaging, and connecting with your audience on a deeper level.</p><p>This section provides you with simple ways to integrate prompts in your day-to-day tasks. For chief marketing officer (CMO) use cases, visit the Executives section of the guide.</p><h3 id="getting-started">Getting started</h3><p>First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of this guide.</p><p>Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write follow-up prompts to build on the initial generated response.</p><h3 id="prompt-iteration-example">Prompt iteration example</h3><h5 id="use-case-develop-a-visual-identity">Use case: Develop a visual identity</h5><p>You own your own consulting business and are often hired to function as a brand manager for your clients. You help businesses in a variety of industries. Your customer is getting ready to launch a coffee shop and video game cafe, and you need to kick-start the creative process by developing a visual identity. You want to ideate and provide early thoughts to the rest of the team. You decide to chat with Gemini Advanced. You type:</p><blockquote><span style="background-color:#f0d0d0">Generate ideas for a creative and eye-catching logo</span><span style="background-color:#fff0c0">for my new business, a coffee shop combined with a video game cafe. Generate a logo considering the following:</span></blockquote><blockquote>
<span style="background-color:#fff0c0">Dual Concept: The logo needs to clearly signal both the coffee and gaming aspects of the business without being too cluttered.</span></blockquote><blockquote>
<span style="background-color:#fff0c0">Target Audience: Appeal to a wide range of gamers (casual and enthusiast), as well as coffee lovers seeking a unique hangout spot.</span></blockquote><blockquote>
<span style="background-color:#e0f0e0">Style Options: I&#x27;m open to these approaches — let&#x27;s get a few examples in each of these three styles to compare: Modern and Playful: Bold colors, fun graphics, maybe a pixel art aesthetic. Retro-Cool: Think classic arcade style — chunky lettering, neon color inspiration. Sleek and Minimalist: Clean lines, geometric shapes, a more subtle nod to both themes. </span></blockquote>
<ul><li><span style="background-color:#d0e0f0">Persona</span></li><li><span style="background-color:#f0d0d0">Task</span></li><li><span style="background-color:#fff0c0">Context</span></li><li><span style="background-color:#e0f0e0">Format</span></li></ul><p>You like the retro-cool options. You continue your conversation and you type:</p><blockquote><span style="background-color:#fff0c0">I like the retro-cool options.</span><span style="background-color:#f0d0d0">Can you provide three more</span><span style="background-color:#e0f0e0">in that same style? </span></blockquote>
<p>Now that you have a sense of what the logo could look like, you want to brainstorm names. You type:</p><blockquote><span style="background-color:#f0d0d0">Write a tagline and 10 potential names</span><span style="background-color:#fff0c0">for the business to go with these logos. </span></blockquote>
<h3 id="example-use-cases">Example use cases</h3><h4 id="brand-manager">Brand Manager</h4><h5 id="new-use-case-develop-brand-strategy"><strong>NEW</strong> Use case: Develop brand strategy</h5><p>You are working to refresh your company&#x27;s brand architecture and messaging frameworks. To get started, you visit Gemini Advanced and type:</p><blockquote><p>I am a brand manager at [company]. Help me define a clear and effective brand architecture for [company], considering its diverse products and service portfolio. For additional context, here is our current brand portfolio: [List all existing brands, products, and services]. Here is our company mission and vision: [Provide a brief overview of the company’s mission and vision]. And these are our target audience(s): [describe target audience(s)]. Our desired brand positioning is [explain how the company wants to be perceived in the market].</p></blockquote>
<h5 id="new-use-case-brainstorm-brand-partnerships"><strong>NEW</strong> Use case: Brainstorm brand partnerships</h5><p>You are working on a new brand campaign. You want to identify influencers or complementary brands you could partner with as part of the social amplification plan. You visit Gemini Advanced and type:</p><blockquote><p>I am a [brand manager] at [company] working to launch a new campaign focused on [topic]. Identify potential types of influencers and complementary brands that [company] could partner with to amplify the [campaign] on social media channels. The goal is to reach a wide audience of [audiences], while building credibility and driving engagement.</p></blockquote>
<h5 id="use-case-conduct-market-research-and-identify-trends">Use case: Conduct market research and identify trends</h5><p>The landscape in your industry is rapidly changing, and you need to conduct market research to better identify and understand emerging trends. You go to Gemini Advanced, and you type:</p><blockquote><p>I need to do market research on [industry] industry to identify new trends. Use [URLs] to uncover emerging trends and shifting consumer preferences.</p></blockquote>
<p>After completing your research, you and the team have new messaging that you want to A/B test. You want to generate multiple variations of ad copy using Gemini Advanced. You type:</p><blockquote><p>I need to A/B test new messaging. Here is our messaging: [messaging]. Generate three different variations of ad copy.</p></blockquote>
<h5 id="use-case-create-and-manage-content-and-distribution">Use case: Create and manage content and distribution</h5><p>A customer has exciting organizational changes underway. You need to create content to shape the brand narrative of the company as it enters its next era. You open a Google Doc to get started on a blog draft. You prompt Gemini in Docs by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Create a blog draft announcing that [name] is joining [company] as [position]. [Share two or three details from their bio, such as their previous position and company, their involvement in professional organizations, etc.].</p></blockquote>
<p>You also want a way to efficiently track how and where this content is amplified, so you open a Google Sheet.<br/>You prompt Gemini in the Sheets side panel. You type:</p><blockquote><p>Create a project tracker for content amplification and include columns for channel, owner, URL, and priority level (low, medium, high).</p></blockquote>
<h4 id="marketing-specialist">Marketing Specialist</h4><h5 id="new-use-case-improve-collaboration-with-customers-agencies-and-teams"><strong>NEW</strong> Use case: Improve collaboration with customers, agencies, and teams</h5><p>You are hosting a meeting discussing an upcoming project with multiple teams and an agency that will complete the project’s design work. You use Gemini in Google Meet and select <strong>Take notes with Gemini</strong> so that all participants can give their undivided attention to the conversation. After the meeting, Gemini provides a summary of the discussion and pulls out action items to keep the team on track.</p><p>From the generated Doc with call notes, you want to create a spreadsheet to help keep the team on track. You open a new Google Sheet and prompt Gemini in the Sheets side panel and tag relevant files by typing @file name. You type:</p><blockquote><p>Generate a project tracker using the action items from @[Meeting Notes from Gemini].</p></blockquote>
<h5 id="new-use-case-analyze-social-media-trends-and-other-data-to-reduce-time-to-market"><strong>NEW</strong> Use case: Analyze social media trends and other data to reduce time to market</h5><p>You want to analyze different data sources and collate findings to help you reduce your time to market.<br/>You open Gemini Advanced and type:</p><blockquote><p>I am a [marketing specialist] at [company]. We are working on our [go to market] plans for [type of product]. Help me research social media trends around [topics]. Be specific about trending keywords, top influencer voices, and common themes in popular content.</p></blockquote>
<p>You verify Gemini&#x27;s response by selecting the <strong>Double-check response</strong> option beneath Gemini&#x27;s response.</p><p>Now, you want to review a report you&#x27;ve commissioned that surveyed customers from different industries. You continue your conversation with Gemini. You upload the relevant file and type:</p><blockquote><p>Analyze the findings in this [report]. I am especially interested in any common themes about [topic] that stand out to you that will help me better position [marketing materials] for [product] for [target audience].</p></blockquote>
<p>(Gemini Advanced) ✦</p><h5 id="new-use-case-perform-audience-research-and-develop-personas"><strong>NEW</strong> Use case: Perform audience research and develop personas</h5><p>You need to refresh your audience research and persona development as the team updates webpage copy, pitch decks, and other marketing assets. You brainstorm and research using Gemini Advanced. You type:</p><blockquote><p>I am a marketing specialist focused on [area] at [company]. I need to conduct in-depth audience research so that I can develop convincing marketing artifacts for [personas]. To start, help me generate a comprehensive profile of [target audience]. Include core demographics and psychographics, online platforms they frequent, key pain points [product] could solve, and language and messaging that resonates with them.</p></blockquote>
<h4 id="digital-marketing-manager">Digital Marketing Manager</h4><h5 id="new-use-case-create-and-optimize-copy-for-search-engine-marketing-sem"><strong>NEW</strong> Use case: Create and optimize copy for search engine marketing (SEM)</h5><p>You want to create a robust list of keywords and long-tail keywords and phrases to uncover new opportunities for SEM targeting. You go to Gemini Advanced and type:</p><blockquote><p>I am a digital marketing manager at [company]. I am working on SEM ads for [product]. Here are my seed keywords: [list keywords]. Help me generate a list of additional keywords and long-tail keywords and phrases that can help me maximize ad performance.</p></blockquote>
<p>After you finish brainstorming your keywords list, you want to generate a few variations of ad copy. You type:</p><blockquote><p>For my SEM campaign, use these keywords as inspiration to generate multiple ad copy variations with different headlines, descriptions, and calls to action for [product]. Use a [tone] tone in the copy.</p></blockquote>
<p>You want to further refine the text according to different audiences, so you type:</p><blockquote><p>Do the same thing, except write new options for [audience], adjust the tone to be [tone] and focus the copy on highlighting [feature] of [product].</p></blockquote>
<h5 id="use-case-draft-customer-acquisition-communications">Use case: Draft customer acquisition communications</h5><p>Email is one of your company&#x27;s main channels of direct communication with prospects and customers. You want help getting started with copy for a new email campaign. You open a new Google Doc, and you prompt Gemini in Docs by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Write three different email subject lines that reference [audience segments] and our [product]. Make them catchy but professional.</p></blockquote>
<p>Now you want to share the proposed email subject lines with the copywriting team. You open Gmail, and you select <strong>Help me write</strong>. You type:</p><blockquote><p>Write an email proposing [suggested email subject lines] to the copywriting team. Keep the email short and simple and request feedback by the end of week. Thank them for their help.</p></blockquote>
<h5 id="use-case-generate-inbound-marketing-campaigns">Use case: Generate inbound marketing campaigns</h5><p>The team created a new ebook on best practices for executives using our new solution. You’re creating a landing page to house the gated asset, and you need engaging copy. You open a new Google Doc and select <strong>Help me write</strong>. You type:</p><blockquote><p>Create compelling copy for a landing page promoting a new [ebook/webinar/free trial and details] designed for an executive target audience. Highlight key benefits and encourage conversions with persuasive calls to action.</p></blockquote>
<p>The webpage launched, and you’re now running an inbound marketing campaign. You need to nurture the leads that downloaded your latest ebook. You open a new Google Doc, and you prompt Gemini in Docs by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Generate copy for a sequence of five automated emails to nurture leads after they download the ebook on [topic]. Personalize emails and encourage further engagement [with other valuable resources or offers].</p></blockquote>
<h4 id="content-marketing-manager">Content Marketing Manager</h4><h5 id="new-use-case-deliver-personalized-content-to-customers-at-scale"><strong>NEW</strong> Use case: Deliver personalized content to customers at scale</h5><p>You want to create copy for a five-step email nurture cadence for your new product. You open a new Google Doc and prompt Gemini in the Docs side panel and tag relevant files by typing @file name. You type:</p><blockquote><p>Create a 5-step nurture email cadence to [prospective customers] who have signed up for [our newsletter], with the goal of getting them to <span>[purchase] [product]</span> using @[Product Specific Notes] and @[Product FAQ].</p></blockquote>
<h5 id="new-use-case-create-visuals-for-ad-campaigns"><strong>NEW</strong> Use case: Create visuals for ad campaigns</h5><p>You want to create visuals to help your creative agency better understand the team’s direction for an upcoming campaign. You open a new Google Slide and prompt Gemini in Slides. You type:</p><blockquote><p>Help me create inspirational images for a marketing campaign for [type of product]. Images should use [colors] and [natural elements, such as clouds]. Use a [photorealistic] style.</p></blockquote>
<h5 id="use-case-generate-inspiration-for-your-blog">Use case: Generate inspiration for your blog</h5><p>You work for a travel company as the content marketing manager for the company’s blog channel. You need to kick-start the brainstorming process for a new blog post. You decide to gather ideas by collaborating with Gemini Advanced. You type:</p><blockquote><p>Suggest blog post topics that would be interesting for people passionate about travel and the tourism industry. Here’s what I want you to focus on: Make the topics unique. There are lots of tourism blogs out there — let’s come up with fresh angles that would stand out. Keep the topics relevant. Tap into current trends or recent challenges/innovations within the tourism industry when brainstorming. I’d like each topic to include:</p><p>Target audience: Who would this topic specifically appeal to?</p><p>Content outline: A few bullet points with the main ideas the blog post would discuss.</p><p>Call to action: Suggest one way to engage the reader at the end of the post.</p></blockquote>
<p>You love the initial ideas you were able to create. You also need to focus on generating creative imagery to accompany the copy in the blog. You type:</p><blockquote><p>Create an image of a plane flying above the clouds over mountains and rivers during sunrise that I can use in the marketing campaign to promote my travel company.</p></blockquote>
<h5 id="use-case-create-social-media-posts">Use case: Create social media posts</h5><p>You&#x27;re focused on creating content that is optimized for social media channels. You need to gather ideas for content targeted to distinct audiences. You open a new Google Doc and prompt Gemini in Docs by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Write three engaging social media posts about [product/service/topic] that would appeal to [target audience]. Keep each social media post to two sentences and include a call to action to visit [our website].</p></blockquote>
<p>You also need to craft social media posts to drive registration for an upcoming event targeting recent grads.<br/>You open a new Google Doc and you prompt Gemini in Docs by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Create a social media post promoting our upcoming [event name]. Include attention-grabbing language and relevant hashtags for [audience].</p></blockquote>
<h5 id="use-case-create-a-strategic-marketing-plan">Use case: Create a strategic marketing plan</h5><p>Your company is launching a new app. You need a robust marketing plan, but you want ideas to get started.<br/>You chat with Gemini Advanced. You type:</p><blockquote><p>I&#x27;m developing a marketing plan for a new app that provides [functionality]. My target audience is [audience]. Help me create a plan with a focus on [marketing channels]. Here&#x27;s what I&#x27;d like you to cover: competitor analysis, ideal marketing channel mix with rationale, budget recommendations, key messaging ideas, and proposed campaign timeline with KPIs.</p></blockquote>
<p>The responses from your chat are helpful in shaping your marketing plan. You need to get the high-level details to your chief marketing officer (CMO). You open Gmail and prompt Gemini in Gmail by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Draft an email to the CMO telling them that I will provide a one-pager with a strategic marketing plan for the new app launch project by [date], and it will include an executive summary, overview of the competitive landscape, top marketing channels, and the target demographic for all South American markets.</p></blockquote>
<h2 id="project-management">Project management</h2><p>As the conductor of complex, ever-evolving projects, your mission is to navigate timelines, coordinate teams, and ensure your programs deliver the intended impact.</p><p>This section provides you with simple ways to integrate prompts in your daily tasks.</p>
<h3 id="getting-started">Getting started</h3><p>First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of this guide.</p><p>Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write follow-up prompts to build on the initial generated response.</p><h3 id="prompt-iteration-example">Prompt iteration example</h3><h5 id="use-case-generate-user-acceptance-tests">Use case: Generate user acceptance tests</h5><p>Your team completed the registration form for a new website, and now you need to generate user acceptance tests (UATs). To start, you visit Gemini Advanced and type:</p><blockquote><span style="background-color:#f0d0d0">Create a table with 10 user acceptance tests (UAT)</span><span style="background-color:#fff0c0">for the website registration form.</span></blockquote>
<ul><li><span style="background-color:#d0e0f0">Persona</span></li><li><span style="background-color:#f0d0d0">Task</span></li><li><span style="background-color:#fff0c0">Context</span></li><li><span style="background-color:#e0f0e0">Format</span></li></ul><p>You think the results are a helpful starting point, so you copy the results to a Google Sheet before drafting an email to your colleague who is running the UATs. You want to explain what they need to do. You continue your conversation with Gemini Advanced. You type:</p><blockquote><span style="background-color:#f0d0d0">Draft an email</span><span style="background-color:#fff0c0">to [my colleague] who is running this UAT and explain what they need to do next.</span></blockquote>
<p>The drafted email provides a helpful starting point, so you export the results to Gmail, and you make edits directly before sending the message to your colleague.</p><h3 id="example-use-cases">Example use cases</h3><h4 id="project-manager">Project Manager</h4><h5 id="use-case-report-on-project-status">Use case: Report on project status</h5><p>You just had a lengthy call with all of your project stakeholders, and now you want to summarize what was discussed and follow up with assigned action items. In the Google Doc with the meeting transcript, you prompt Gemini in Docs. You type:</p><blockquote><p>Summarize this call transcript in a short paragraph. In bullet points, highlight the action items, decisions made, and owners for each item based off of [call transcript].</p></blockquote>
<p>You need to update your manager based on the activity from the last call. You want to templatize how your project status updates are delivered. You open a new Google Doc, and you prompt Gemini in Docs by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Draft a project status update email template to send to my manager. Include sections for a summary of key accomplishments this week, any challenges faced, and the top three priorities for next week.</p></blockquote>
<p>The team just hit its key milestones an entire week early. It’s been a challenging project, so you want to gather everyone to celebrate together. You open Gmail and prompt Gemini in Gmail by selecting <strong>Help me write</strong>.</p><p>You type:</p><blockquote><p>Write an invitation for a team lunch to celebrate the progress made on a project and include [date, time, and location]. Thank them for all of their hard work and acknowledge that this has been a challenging project.</p></blockquote>
<h5 id="use-case-create-a-project-retrospective">Use case: Create a project retrospective</h5><p>You&#x27;ve just wrapped the project, and your senior leadership team needs a project retrospective. To kick-start the process of gathering feedback, you open a Google Doc and prompt Gemini in Docs by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>I need to write a report detailing the successes, failures, and lessons learned from [project]. Draft a list of 20 questions to guide a cross-team process investigation. Include questions to uncover what worked, what didn&#x27;t, specific process breakdowns, technical issues, communication gaps, or any other potential contributing factors to the problem or success of the project.</p></blockquote>
<p>The questions give you a great starting place. You edit them before sharing with the team for their input. After you gather everyone’s feedback, you want help structuring the report. You prompt Gemini in Docs by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Summarize this document in two paragraphs. Include high-level information about the project’s goals, the main contributors, the outcomes of the project, and any key successes or failures.</p></blockquote>
<h5 id="use-case-develop-an-issue-tracker-and-related-communications">Use case: Develop an issue tracker and related communications</h5><p>You need to create a project issue tracker to keep track of risks and solve them in a timely manner. You want to create a template quickly, so you open a new Google Sheet and prompt Gemini in the Sheets side panel. You type:</p><blockquote><p>Create a spreadsheet to track project issues, including descriptions, status, assigned owner, and action items for resolution.</p></blockquote>
<p>Before the project fully kicks off, you want to have standardized communication templates at your disposal. For example, you want an email that can be used if an issue arises. You open a new Google Doc and prompt Gemini in Docs by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Draft an email template to announce when an issue arises and include causes, solutions, and timelines to resolve it.</p></blockquote>
<p>You like the template that Gemini in Docs creates, and you want to create an additional, slightly different email template. In the same Google Doc, you prompt Gemini in Docs by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Draft an email template to a stakeholder to escalate a critical project issue, outlining the impact and proposed solution.</p></blockquote>
<h4 id="technical-project-manager">Technical Project Manager</h4><h5 id="new-use-case-create-a-workback-schedule"><strong>NEW</strong> Use case: Create a workback schedule</h5><p>You are the technical project manager for a software release. You already have the scope of the project documented. Now, you want to get started on building a workstream tracker and workback schedule. You go to Gemini Advanced and type:</p><blockquote><p>I am a [technical project manager] at [company] overseeing [project and brief project description].<br/>The project has the following scope: [scope]. Our project goals are: [project goals]. Our project deliverables are: [project deliverables]. Our budget is [budget], and our delivery date is [delivery date].<br/>Help me create a workback schedule to keep the team on track. Include dates for key milestones and demos.</p></blockquote>
<h2 id="sales">Sales</h2><p>Understanding your customers inside and out is your ticket to success. You’re in charge of maintaining critical relationships, deciphering buying signals, crafting tailored solutions, driving revenue for the business, and more.</p><p>This section provides you with simple ways to integrate prompts in your daily tasks.</p><h3 id="getting-started">Getting started</h3><p>First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of this guide.</p><p>Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can collaborate with Gemini for Google Workspace. The prompt iteration example shows how you could write follow-up prompts to build on the initial generated response.</p><h3 id="prompt-iteration-example">Prompt iteration example</h3><h5 id="use-case-conduct-customer-research">Use case: Conduct customer research</h5><p>You&#x27;re an account executive, and you&#x27;ve just been assigned to a new customer. You need a research assistant. You will need to get to know key contacts at the account to begin building trust between your teams, but first, you want to send an introductory email, so you open Gmail and prompt Gemini in Gmail by selecting <strong>Help me write</strong>. You type:</p><blockquote><span style="background-color:#f0d0d0">Write an email to [name], the new [title] at [company].</span><span style="background-color:#fff0c0">Congratulate them on their new role. Introduce me as their contact point at [company name]. Invite them to lunch next week and check if they prefer Monday or Tuesday. </span></blockquote>
<ul><li><span style="background-color:#d0e0f0">Persona</span></li><li><span style="background-color:#f0d0d0">Task</span></li><li><span style="background-color:#fff0c0">Context</span></li><li><span style="background-color:#e0f0e0">Format</span></li></ul><p>Gemini in Gmail: [Drafts email]</p><p>This provides a helpful starting point, but you want to try getting an even better response. You click <strong>Refine</strong> and <strong>Formalize</strong>.</p><p>You&#x27;re happy with the email, so you click <strong>Insert</strong>. You read the message one last time, make final light edits directly, and then send the message. Now, you want to learn more about the customer and how it markets itself. To research, you visit Gemini Advanced and type:</p><blockquote><span style="background-color:#d0e0f0">I am an account executive in charge of a new account, [customer name].</span><span style="background-color:#fff0c0">I need to do initial research. </span><span style="background-color:#f0d0d0">What is the market strategy of [customer]? </span></blockquote>
<p>Gemini provides you with useful information to get started in your research. You continue your research by first focusing on news announcements. You gather a list of URLs, and you paste them into your conversation with Gemini Advanced. You type:</p><blockquote><span style="background-color:#fff0c0">[URLs] </span><span style="background-color:#f0d0d0">Summarize these articles.</span><span style="background-color:#e0f0e0">Provide key insights and contextualize why these announcements are important. </span></blockquote>
<p>Now you have a clear summary of what was announced, why the news is important, and additional insights. Next, you want to better understand the executive who will be your main point of contact. You find a recorded interview featuring the executive. You paste the YouTube URL into your conversation with Gemini Advanced and type:</p><blockquote><span style="background-color:#fff0c0">[YouTube URL] </span><span style="background-color:#f0d0d0">Summarize this interview and tell me more about [executive name].</span><span style="background-color:#e0f0e0">What does [executive] care about? </span></blockquote>
<p>You continue the conversation with additional lines of questioning to build familiarity with your key contact and the account. You prompt:</p><blockquote><span style="background-color:#f0d0d0">Tell me how [company] can help [customer company] with achieving their goals. </span></blockquote>
<p>Once you wrap up your conversation, you export your results into a Google Doc. You open the Google Doc and prompt Gemini in Docs. You type:</p><blockquote><span style="background-color:#f0d0d0">Create an email draft </span><span style="background-color:#fff0c0">for [customer] explaining why [your company] is the perfect partner for them to achieve their market goals. </span></blockquote>
<h3 id="example-use-cases">Example use cases</h3><h4 id="customer-success-manager">Customer Success Manager</h4><h5 id="new-use-case-map-customer-journeys"><strong>NEW</strong> Use case: Map customer journeys</h5><p>It&#x27;s your first time onboarding a new customer, and you realize you could benefit from creating custom-tailored assets. You open a new Doc and prompt Gemini in the Docs side panel and tag relevant files by typing @file name. You type:</p><blockquote><p>Create personalized onboarding materials for [customer]. Use @[Standard Onboarding Documents] and @[New Customer Migration Notes] to personalize the assets.</p></blockquote>
<h4 id="sales-manager">Sales Manager</h4><h5 id="new-use-case-manage-the-request-for-proposal-rfp-process"><strong>NEW</strong> Use case: Manage the request for proposal (RFP) process</h5><p>You&#x27;ve just received an RFP, and you want to quickly ingest the request as part of your information gathering process. First, you want to do basic research on the company that issued the request. You visit Gemini Advanced and you type:</p><blockquote><p>I just received an RFP from [company]. Before I dive into the RFP, I want your help in conducting research. Give me a business profile of the company including all of the basics (where they are located, what they provide for customers, who their target audience is, any recent news from the company). Be as detailed as possible as I want to see a full view of [the company].</p></blockquote>
<p>Once you finish your research on the company, you want to summarize the RFP. You continue your conversation with Gemini. You type:</p><blockquote><p>[URL or uploaded file] I am a sales manager at [company], and this is the RFP we’ve received from [company]. Summarize this content in a few paragraphs. What is the customer seeking, what is the budget, and when is a response due by?</p></blockquote>
<h5 id="new-use-case-access-information-and-tools-on-your-phone-while-on-the-go"><strong>NEW</strong> Use case: Access information and tools on your phone while on the go</h5><p>You are working remotely from your phone. From the mobile app, you open a thread in Gmail and select the Gemini chip to <strong>Summarize this email</strong>. Gemini quickly provides you with a summary of the back and forth so that you can focus on the most important points.</p><p>Now, you want to generate a response acknowledging the latest developments. You prompt Gemini in Gmail.</p><p>You type:</p><blockquote><p>Write a response to this email letting [them] know that I’ve received the message and will take [action] by [Friday].</p></blockquote>
<h5 id="use-case-develop-customer-relationships">Use case: Develop customer relationships</h5><p>Your annual conference is coming up, and your most important prospects will be there. You want to personally invite them to a happy hour. You open Gmail and prompt Gemini in Gmail by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Write an email inviting people interested in [focus area] to our happy hour taking place on [date, time] at [trade show event]. Include that we specialize in [focus area].</p></blockquote>
<p>Now that the event is over, you want to follow up with customers who came to the happy hour. You open Gmail and prompt Gemini in Gmail by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Draft an email thanking customers for their time at the happy hour on [date, time, location]. End with an invitation to continue the conversations in the next few weeks. Use a friendly tone.</p></blockquote>
<p>You want to check in with the customers who attended workshops at the conference because their early feedback is important. You prompt Gemini in Docs. You type:</p><blockquote><p>Draft 10 questions that I can use to survey customers about their recent experience with our [product/ service]. Include questions to gauge how useful [the product] is, what they liked, and what they thought could use improvement.</p></blockquote>
<h5 id="use-case-support-the-sales-team">Use case: Support the sales team</h5><p>You need to contact all of your team leads in the Southeast region to provide immediate guidance on how to proactively reach out to customers about an ongoing issue. You open Gmail and prompt Gemini in Gmail by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Draft an email to all Southeast region sales leads. Inform them of [issues]. Advise them to communicate with their teams to contact their customers and offer a 20% discount on a future order as an apology.</p></blockquote>
<p>Now, you need to email all of the regional team members. You open Gmail and prompt Gemini in Gmail by selecting <em>Help me write</em>. You type:</p><blockquote><p>Draft an email to the regional sales representatives about an urgent meeting that needs to take place next week about the [issues]. Ask them to provide availability on Monday or Tuesday.</p></blockquote>
<h5 id="use-case-coach-and-train-the-sales-team">Use case: Coach and train the sales team</h5><p>You&#x27;ve heard from many team members that they want more learning opportunities. You&#x27;re organizing a half-day learning program to support this request. You need to create a schedule, so you open a new Google Doc and</p><p>prompt Gemini in Docs by selecting Help me write. You type:</p><blockquote>
<p>Create a half-day agenda for an educational session on our latest technology [products] for sales teams. Include time for the product development team to present and include time for lunch.</p></blockquote>
<p>As a follow up to the team meeting, you want to highlight different learning opportunities available. You open Google Sheets and prompt Gemini in the Sheets side panel. You type:</p><blockquote><p>Create a spreadsheet that tracks online courses for sellers. Include columns for the course&#x27;s main topic, price, duration, and priority level.</p></blockquote>
<p>Account Manager and Account Executive</p><h5 id="new-use-case-improve-collaboration-and-execution-by-customizing-sales-materials"><strong>NEW</strong> Use case: Improve collaboration and execution by customizing sales materials</h5><p>You are having an important meeting with a customer. From Google Meet, you turn on <strong>Transcription</strong> and activate Gemini in Meet by selecting <strong>Take notes with Gemini</strong>. The transcript provides an unedited Doc of what was said. The <strong>Take notes with Gemini</strong> file will generate notes recapping the meeting, important topics discussed, and action items. Now, you can fully engage with the customer conversation. (Gemini in Meet)</p><p>After the call, you want to send a recap message to the customer. You open a new message and prompt Gemini in the Gmail side panel and tag relevant files by typing @file name. You type:</p><blockquote><p>Write a message to [customer] thanking them for their time at our last [meeting]. Provide a quick summary of the meeting and acknowledge any pain points discussed. Ask for additional time to discuss our [solution] using @[Customer Meeting Gemini Notes].</p></blockquote>
<p>In preparation for your next meeting, you want to use the transcript and your existing sales materials to generate a customized asset that showcases how your company’s product solves the customer’s pain points mentioned during the call. To do this, you open a new Doc and prompt Gemini in the Docs side panel and tag relevant files by typing @file name. You type:</p><blockquote><p>I am an [account manager] and I just finished a call with [customer]. I want to summarize the [pain points] mentioned by [customer] during our last meeting. Provide a list of direct quotes from @[Customer Call Transcript] where [customer] discusses what they are trying to solve.</p></blockquote>
<p>You read through the summary of pain points and see that they capture what was discussed. You click <strong>Insert</strong> from the side panel. Then, you want to use your existing files to generate custom responses to each of their pain points. You prompt Gemini in the Docs side panel again and tag relevant files. You type:</p><blockquote><p>I need to create convincing reasons why [customer] should adopt [product] to solve for [their pain points]. Write specific reasons why [product] from [company] could help them achieve their [business goals] using @[Product Sales Kit Full Assets].</p></blockquote>
<h5 id="use-case-build-customer-relationships">Use case: Build customer relationships</h5><p>You just had a great call with a customer and now you want to use the notes you took from the meeting in Google Docs to draft an email to the customer. In the Google Doc with your notes, you prompt Gemini in Docs by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Compose a personalized follow-up email to [client] following an initial conversation. Summarize the key points we discussed and address any outstanding questions.</p></blockquote>
<p>The account has just adopted one of the company&#x27;s service offerings and you need to ensure that they feel supported during the onboarding process. You want to make sure you check in on how things are progressing once a week, but you want to explore what the emails could look like. You open a new Google Doc and prompt Gemini in Docs by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Draft four email templates to check in on my customer weekly now that they have purchased our new [service]. Use one value proposition (cost, ease of use, security, availability, and customization) as the main topic for each email, and include [call to action] in each message.</p></blockquote>
<h5 id="use-case-prepare-for-new-customer-calls">Use case: Prepare for new customer calls</h5><p>You have an upcoming call with a prospect. This is a brand new use case for you, and you need help preparing for the call. You visit Gemini Advanced, and you type:</p><blockquote><p>Draft a customized script for me to follow during my sales call with a prospect. The call will happen over a video call and is set to last 30 minutes. Make sure to add the following in the script: how [company products/solutions] can help address potential customer’s pain points, how [company]’s delivery system guarantees seamless and timely delivery, competitive pricing and volume-discount table, and space for a customer reference in the [customer’s industry] industry.</p></blockquote>
<p>Now that you’ve done initial research, you export your findings to a new Google Doc. You open the Google Doc and continue working. Now, you want to create a tailored pitch. Using the Google Doc with all of your research notes, you prompt Gemini in Docs by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Generate an elevator pitch for [product name] and include key benefits, competitive points of differentiation, and the pain points that [product name] solves for.</p></blockquote>
<p>You have a great start to your elevator pitch and short talking points. You want to use this to further anticipate how the customer call might go. You resume your meeting preparation by returning to Gemini Advanced.</p><p>You type:</p><blockquote><p>I have an upcoming call with a prospect. [Use case] is a new use case for me, and I need help preparing for the call. List the most likely objections [customer] might have for me during a sales call, with suggestions on how to respond to them. I work in [industry], and I am trying to sell [product]. Also provide ideas on how to handle objections and suggest ways to respond.</p></blockquote>
<h4 id="business-development-manager">Business Development Manager</h4><h5 id="use-case-nurture-relationships-personalized-outreach-and-thought-leadership">Use case: Nurture relationships, personalized outreach, and thought leadership</h5><p>You&#x27;re hoping to build deeper relationships with prospective customers that you recently met. You want to draft a template that you can customize for multiple contacts. You open a new Google Doc, and you prompt Gemini in Docs. You type:</p><blockquote><p>Draft an outreach email template to industry influencers. Express gratitude that we connected at [event], and propose collaboration opportunities such as [opportunities].</p></blockquote>
<p>After having a successful call with prospective customers, you want to follow up with thought leadership content from your founder that they may find interesting. You open the Google Doc with the blog post, and prompt Gemini in Docs by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Summarize this blog content in bullet points and generate three ideas for follow-up questions I can ask my customers about their thoughts.</p></blockquote>
<h5 id="use-case-generate-personalized-customer-appreciation-materials">Use case: Generate personalized customer appreciation materials</h5><p>You want to personally thank your customers and check in. You open Gmail and prompt Gemini in Gmail by selecting <strong>Help me write</strong>. You type:</p><blockquote><p>Generate a personalized email for [customer] on their one-month anniversary working with [company]. Thank them for being a customer. Ask them if they have any questions. Include information about [other product].</p></blockquote>
<p>You also want to send these customers a gift to thank them. You open a Google Sheet and prompt Gemini in the Sheets side panel. You type:</p><blockquote><p>Give me a list of gifts to send new clients that are under $200 and can be shipped to offices.</p></blockquote>
<h2 id="small-business-owners-and-entrepreneurs">Small business owners and entrepreneurs</h2><p>As the owner of a business, getting the most out of your working hours is critical when you’re juggling multiple roles and responsibilities. Understanding your market, delivering for your customers, and staying on top of many competing priorities is critical.</p><p>This section introduces you to AI prompts designed to simplify complex choices with AI data analysis, streamline your email inbox, and help you stand out with creative marketing tactics. Discover how Gemini for Google Workspace can help you unlock deep insights, foster collaboration, and help propel your company to new heights.</p><h3 id="getting-started">Getting started</h3><p>First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of this guide.</p><p>Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can collaborate with Gemini for Workspace. The prompt iteration example shows how you could write follow-up prompts to build on the initial generated response.</p><h3 id="prompt-iteration-example">Prompt iteration example</h3><h5 id="use-case-create-pricing-comparison">Use case: Create pricing comparison</h5><p>You are the owner of a local spa. You are evaluating offers you’ve received from two different cleaning companies. You want to find a company with the right price, flexibility, and level of service. You open a new Doc and prompt Gemini in the Docs side panel and tag relevant files by typing @file name in your prompt. You type:</p><blockquote><span style="background-color:#d0e0f0">I&#x27;m a business owner</span><span style="background-color:#f0d0d0">and I&#x27;m trying to determine the right cleaning vendor using</span><span style="background-color:#fff0c0">@[Company A Proposal] and @[Company B Proposal]. I need someone to come twice a week, and I want them to vacuum, mop, dust, clean the windows, and wipe down all surfaces. If available, include information about the booking and cancellation policy.</span><span style="background-color:#f0d0d0">Create a comparison table between the two companies’ proposals. </span></blockquote>
<ul><li><span style="background-color:#d0e0f0">Persona</span></li><li><span style="background-color:#f0d0d0">Task</span></li><li><span style="background-color:#fff0c0">Context</span></li><li><span style="background-color:#e0f0e0">Format</span></li></ul><p>Gemini returns a formatted table comparing the two proposals. After you make your decision, you go to your email and prompt Gemini in the Gmail side panel. You type:</p><blockquote><span style="background-color:#f0d0d0">Write an email to Company</span><span style="background-color:#fff0c0">A thanking them for their time and their proposal.</span><span style="background-color:#f0d0d0">Ask for a few times to meet to schedule cleanings. </span></blockquote>
<h3 id="example-use-cases">Example use cases</h3><h4 id="owner">Owner</h4><h5 id="use-case-enhance-personal-productivity">Use case: Enhance personal productivity</h5><p>You have many important email messages to catch up on. You open your email and select an important thread. You open Gemini in the Gmail side panel, and it automatically summarizes the content.</p><h5 id="use-case-brainstorm-and-generate-marketing-content">Use case: Brainstorm and generate marketing content</h5><p>As the business owner, you are also responsible for marketing your services via your social channels, your email-based newsletter, and email marketing. You aren’t sure where to start, so you chat with Gemini Advanced. You type:</p><blockquote><p>I own a [type of business] in [location]. I am working on marketing materials to advertise [event/sale] on [services]. I want to focus on using this sale to bring in repeat customers who haven’t purchased in a while and new customers alike. I want the social posts to feel [inspirational] and [fun]. Suggest some social copy I can use on [social platform] with relevant hashtags, suggested newsletter copy, and two email drafts (one for existing customers and one for new customers).</p></blockquote>
<p>You like the suggestions Gemini provided, so you select <strong>Share &amp; export</strong> and <strong>Export to Docs</strong>. You want to continue your brainstorm, so you ask Gemini:</p><blockquote><p>What are some other effective [event/sale] tactics I can use to bring in new customers? I don’t always want to offer discounts. Are there other incentives I am overlooking?</p></blockquote>
<p>You continue your conversation with Gemini and are able to create a solid list of marketing tactics to try.</p><h5 id="use-case-develop-a-competitive-analysis">Use case: Develop a competitive analysis</h5><p>You started a company, and your online business is gaining traction. You have always dreamed of opening a brick-and-mortar store, and now might be the perfect time. You want a thought partner to help you better understand the current landscape. You open Gemini Advanced, and you type:</p><blockquote><p>I am an online business owner. I am considering opening a brick-and-mortar store. Conduct an analysis into the competitive landscape focusing on [focus area]. Provide the strengths and weaknesses of [key competitors] in this area, including their specific strategies, tactics, and results. Identify actionable insights and recommendations for how [my company] can improve its approach and gain a competitive advantage.</p></blockquote>
<p>You gathered useful information from your discussion with Gemini Advanced. You want to go deeper in your brainstorming around two competitors in particular. You type:</p><blockquote><p>Generate a competitive analysis of [company] versus [competitor] within the current market landscape.</p></blockquote>
<p>You select <strong>Share &amp; export</strong> and <strong>Export to Docs</strong>.</p><h5 id="use-case-conduct-fundraising-and-investor-relations">Use case: Conduct fundraising and investor relations</h5><p>You&#x27;re ready to reach out to potential investors to make your brick-and-mortar store a reality. You want help getting started on an email to investors, so in the same Google Doc with your competitive analysis research, you prompt Gemini in Docs. You type:</p><blockquote><p>Draft a personalized email template to potential investors, highlighting [company&#x27;s] unique value proposition and recent progress on [initiatives]. Request a time to meet to discuss opportunities to collaborate in the next month.</p></blockquote>
<p>The email template gives you a starting place. You tweak the draft and continue to add a few personal touches before sending the email to the potential investors. After a successful meeting with them a month later, you want to draft a thank you message. You open your Google Doc with the meeting transcript and notes. You prompt Gemini in Docs to help you write an email draft. You type:</p><blockquote><p>Draft an email thanking a potential investor for the call and ask for time to schedule a follow-up meeting to address [questions and concerns].</p></blockquote>
<h5 id="use-case-manage-time-off-policies-and-tracking">Use case: Manage time off policies and tracking</h5><p>You have a lengthy handbook detailing all of your company’s policies and procedures. You want to make the time-off request policy easily digestible for new hires. You open the Google Doc with the handbook. You prompt Gemini in Docs by selecting Help me write. You type:</p><blockquote><p>Generate a step-by-step checklist summarizing the company’s time-off request policy. Ensure it is written in plain language and easy for employees to understand.</p></blockquote>
<p>You need a quick way to track staffing each week because many of your employees are shift-based. You open Gemini in the Sheets side panel. You type:</p><blockquote><p>Create a table that tracks weekly staffing. Create columns for date, name, shift (AM or PM), and notes.</p></blockquote>
<h2 id="startup-leaders">Startup leaders</h2><p>You thrive in fast-paced, dynamic environments where you can wear many hats and make a tangible impact. You’re driven by a passion for innovation, a desire to learn and grow, and a tolerance for risk. Your work is unique in its variety, its potential for high reward, and its direct connection to the company’s success. You’re not just executing tasks; you’re building something from the ground up, shaping the future of your company, and potentially disrupting entire industries.</p><p>Gemini for Google Workspace can help you redefine productivity and foster meaningful connections with investors, customers, and coworkers. This section provides practical prompts and real-world use cases designed specifically for you and your team. Learning to write effective prompts with Gemini for Workspace will help improve your productivity and streamline your everyday tasks, giving you more time to focus on strategic work.</p><h3 id="getting-started">Getting started</h3><p>First, review the general prompt-writing tips on page 2 and the Prompting 101 section at the beginning of this guide.</p><p>Each prompt below is presented with an accompanying scenario to serve as inspiration for how you can collaborate with Gemini for Workspace. The prompt iteration example shows how you could write follow-up prompts to build on the initial generated response.</p><h3 id="prompt-iteration-example">Prompt iteration example</h3><h5 id="use-case-brainstorm-business-and-strategy">Use case: Brainstorm business and strategy</h5><p>You just had a productive planning and strategy brainstorming session with colleagues and you took many notes physically on a whiteboard. You snap a quick image with your phone and upload it directly to Gemini Advanced.<br/>You type:</p><blockquote><span style="background-color:#d0e0f0">I am a founder at a startup focused on [industry].</span><span style="background-color:#f0d0d0">I was brainstorming with colleagues about [topic], and we took notes on this whiteboard. </span><span style="background-color:#f0d0d0">Turn these notes into text. </span></blockquote>
<ul><li><span style="background-color:#d0e0f0">Persona</span></li><li><span style="background-color:#f0d0d0">Task</span></li><li><span style="background-color:#fff0c0">Context</span></li><li><span style="background-color:#e0f0e0">Format</span></li></ul><p>Now you want to proactively continue brainstorming before you recap all of the ideas and notes for the group in a follow-up email. You continue the conversation and type:</p><blockquote><span style="background-color:#f0d0d0">Suggest follow-up items we could discuss for our [topic of brainstorm session].</span><span style="background-color:#fff0c0">What was not covered that could have been, and what are we potentially missing?</span></blockquote>
<p>You save all of your notes by clicking <strong>Share &amp; export</strong> and <strong>Export to Docs</strong>. You are ready to send the recap message to the team, so you open your email and prompt Gemini in the Gmail side panel and tag the relevant file of notes by typing <code>@file name</code>. You type:</p><blockquote><span style="background-color:#fff0c0">Use @[Brainstorm Notes and Ideas 9/1/24]</span><span style="background-color:#f0d0d0">to write a meeting recap to the team</span><span style="background-color:#e0f0e0">using an upbeat and friendly tone.</span><span style="background-color:#f0d0d0">Share some of the ideas I have for our next meeting to discuss [topic]. </span></blockquote>
<h3 id="example-use-cases">Example use cases</h3><h4 id="founder">Founder</h4><h5 id="use-case-create-an-elevator-pitch-speech-to-text">Use case: Create an elevator pitch (speech to text)</h5><p>You&#x27;re scheduled to present to a group of prospective investors. This will be your first time discussing your business with this audience. You need to work on your elevator pitch, so you chat with Gemini Advanced using your voice to prompt. You select the microphone icon and say:</p><blockquote><p>I&#x27;m the founder of [startup] in [industry], and I need help creating a short elevator pitch for [company and product description]. I need to make the pitch relevant to [audience] and I want to especially highlight [key features of product] because I want them to [take this action]. Include a compelling hook and anticipate questions an investor might have. Make the tone professional but relaxed and confident.</p></blockquote>
<h5 id="use-case-develop-your-personal-brand">Use case: Develop your personal brand</h5><p>As your company grows, you&#x27;re working on increasing your social media presence, so you want to define and hone your personal brand. To brainstorm, you turn to Gemini Advanced. You type:</p><blockquote><p>Help me grow my personal brand. I am the founder of [a startup] in [industry]. I am passionate about [topics]. I want to inspire [audience] with business tips and lessons I’ve learned from starting my own company. My goals are to build a following so that I can [generate more media] for the business.</p></blockquote>
<p>Gemini returns insights into how you can begin to build messaging and content that aligns to your personal brand and that can help you achieve your goals.</p><h4 id="head-of-operations">Head of Operations</h4><h5 id="use-case-communicate-and-negotiate-with-vendors">Use case: Communicate and negotiate with vendors</h5><p>You&#x27;ve received a quote from two different manufacturers to create packaging for the company&#x27;s new product. You want to compare and contrast the offers before you negotiate. You open a new Doc and prompt Gemini in the Docs side panel and reference relevant files by typing @file name. You type:</p><blockquote><p>I need to make a vendor decision for packaging manufacturing. Create a table that compares the two proposals I’ve received @[Company A’s Proposal] and @[Company B’s Proposal].</p></blockquote>
<p>Gemini creates a table comparing the two different proposals. You make a decision, but now you want to see if you can negotiate with your preferred vendor. You go to your inbox and start a new email draft. You prompt Gemini in the Gmail side panel. You type:</p><blockquote><p>Create an email draft to [selected vendor] telling them that I’ve decided to move forward with them as the [packaging] vendor, but I would like to negotiate [a bulk pricing discount]. Use a collaborative tone.</p></blockquote>
<p>Gemini in Gmail returns a drafted message that is ready to send. You select Insert and send the email.</p><h5 id="use-case-plan-and-track-budgets">Use case: Plan and track budgets</h5><p>You&#x27;re in planning mode and you first want to understand where previous years&#x27; budgets were spent. You have all of this data in a Sheet. You decide to chat with Gemini Advanced. You upload the Sheet and prompt Gemini by typing:</p><blockquote><p>Using the attached spreadsheet, identify trends and patterns in our expenses by category over the last three years. Identify areas where costs have increased significantly and investigate potential reasons.</p></blockquote>
<p>Gemini returns a response that helps inform your budget proposal for next year.</p><h4 id="head-of-product">Head of Product</h4><h5 id="use-case-develop-a-product-launch-plan">Use case: Develop a product launch plan</h5><p>Your team is creating a new product, and you want to conduct research to inform your launch plan in collaboration with the marketing team. Using Gemini, you want to simulate different launch scenarios based on factors like pricing, marketing strategies, and target audience. You go to Gemini Advanced to conduct research and type:</p><blockquote><p>I am head of product at [startup] in [industry] industry. We are building a product launch plan for [product]. I want to brainstorm a few different scenarios. We are considering offering the [product] at two different price points [A and B] and we are considering launching in [December or January]. Provide pros and cons of each scenario and suggest different ideas we may not have considered.</p></blockquote>
<p>You want to continue market research brainstorming. You type:</p><blockquote><p>How do these prices compare to [competitor products&#x27;] prices? Detail what pricing strategies [competitors] use for [products], and list any common tactics they use (such as free trials, discounts, etc.). Summarize how they position the product to [audience]. Cite your sources.</p></blockquote>
<p>Your research helps you refine your pricing structure and go-to-market strategy for your most important target audience.</p><h5 id="use-case-develop-product-strategy-and-roadmap">Use case: Develop product strategy and roadmap</h5><p>You want to refine your product strategy and roadmap. You’ve collected user feedback in a spreadsheet, and you want to clean it up so that it is ready for deeper analysis. You chat with Gemini Advanced and upload a file. You type:</p><blockquote><p>Help me clean my [user feedback] survey spreadsheet. Specifically, fill any blank values in the name column with “Anonymous,” then if the [recommend] column shows [Yes], replace that with [Y]. Finally, remove any rows where the satisfaction column is blank. Please generate a new file for me with my cleaned data.</p></blockquote>
<p>Gemini returns a clean file for you to conduct deeper analysis on, and from this file, you notice a few trends. You have alignment from the team on features to address recurring user feedback, and now you want to build a high-level roadmap that you can use as a starting point. You continue your conversation with Gemini Advanced. You type:</p><blockquote><p>I am head of product at [startup] in the [industry] industry. We are adding [features] to our [product] to address recurring user feedback, including [feedback trends]. Build a high-level roadmap that will keep us on track for a Q4 delivery. Put it in a table format.</p></blockquote>
<p>Gemini returns a helpful starting point. You want to save the work so you click Export to Docs.</p><h2 id="leveling-up-your-prompt-writing">Leveling up your prompt writing</h2><p>This guide is meant to serve as inspiration, and the possibilities are nearly endless with Gemini for Google Workspace. Build on your prompt-writing skills using these tips.</p><ul><li><p><strong>Break it up.</strong> If you want Gemini for Workspace to perform several related tasks, break them into separate prompts.</p></li><li><p><strong>Give constraints.</strong> To generate specific results, include details in your prompt such as character count limits or the number of options you’d like to generate.</p></li><li><p><strong>Assign a role.</strong> To encourage creativity, assign a role. You can do this by starting your prompt with language like: &quot;You are the head of a creative department for a leading advertising agency ...&quot;</p></li><li><p><strong>Ask for feedback.</strong> In your conversation with Gemini Advanced, tell it that you’re giving it a project, include all the relevant details, and then describe the output you want. Continue the conversation by asking questions like, “What questions do you have for me that would help you provide the best output?”</p></li><li><p><strong>Consider tone.</strong> Tailor your prompts to suit your intended audience. Ask for outputs to have a specific tone, such as formal, informal, technical, creative, or casual.</p></li><li><p><strong>Say it another way.</strong> Fine-tune your prompts if the results don’t meet your expectations or if you believe there’s room for improvement. An iterative process of review and refinement often yields better results.</p></li></ul><p>Generative AI and all of its possibilities are exciting, but it’s still new. Even though our models are getting better every day, prompts can sometimes have unpredictable responses.</p><p>Before putting an output from Gemini for Workspace into action, review it to ensure clarity, relevance, and accuracy. And of course, keep the most important thing in mind: Generative AI is meant to help humans, but the final output is yours.</p><p>The example prompts in this guide are meant for illustrative purposes.</p></div><p style="text-align:right"><a href="https://hyli.xyz/posts/docs/gemini-for-google-workspace-prompting-guide-101#comments">看完了？说点什么呢</a></p></div>]]></description><link>https://hyli.xyz/posts/docs/gemini-for-google-workspace-prompting-guide-101</link><guid isPermaLink="true">https://hyli.xyz/posts/docs/gemini-for-google-workspace-prompting-guide-101</guid><dc:creator><![CDATA[行雺]]></dc:creator><pubDate>Tue, 09 Dec 2025 13:59:47 GMT</pubDate></item><item><title><![CDATA[Ascend C 算子开发文档目录]]></title><description><![CDATA[<div><blockquote>该渲染由 Shiro API 生成，可能存在排版问题，最佳体验请前往：<a href="https://hyli.xyz/posts/docs/ascend-c">https://hyli.xyz/posts/docs/ascend-c</a></blockquote><div><p>基于 CANN 社区版 8.2.RC1 制作</p><h2 id="ascend-c-">Ascend C 算子开发</h2><ul><li><ol start="1"><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0001.html">Ascend C简介</a></li></ol></li><li><ol start="2"><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0002.html">环境准备</a></li></ol></li><li><ol start="3"><li>快速入门
<ul><li>3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0004.html">HelloWorld</a></li><li>3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0005.html">基于Kernel直调工程的算子开发</a></li><li>3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0006.html">基于自定义算子工程的算子开发</a></li></ul></li></ol></li><li><ol start="4"><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0015.html">抽象硬件架构</a></li></ol></li><li><ol start="5"><li>编程模型
<ul><li>5.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0013.html">SPMD模型</a></li><li>5.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0014.html">核函数</a></li><li>5.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0016.html">编程范式</a></li><li>5.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0018.html">编程接口概述</a></li></ul></li></ol></li><li><ol start="6"><li>算子实现
<ul><li>6.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0031.html">概述</a></li><li>6.2. 矢量编程
<ul><li>6.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10001.html">概述</a></li><li>6.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0033.html">基础矢量算子</a></li><li>6.2.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10003.html">TBuf的使用</a></li><li>6.2.4. 多核&amp;Tiling切分
<ul><li>6.2.4.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10005.html">概述</a></li><li>6.2.4.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0035.html">多核Tiling</a></li><li>6.2.4.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_00009.html">尾块Tiling</a></li><li>6.2.4.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10008.html">尾核Tiling</a></li><li>6.2.4.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10009.html">尾核&amp;尾块</a></li></ul></li><li>6.2.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10010.html">DoubleBuffer场景</a></li><li>6.2.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10011.html">Broadcast场景</a></li><li>6.2.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0034.html">非对齐场景</a></li></ul></li><li>6.3. 矩阵编程（高阶API）
<ul><li>6.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0037.html">基础知识</a></li><li>6.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0038.html">算子实现</a></li><li>6.3.3. 特性场景
<ul><li>6.3.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10012.html">Matmul特性介绍</a></li><li>6.3.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10013.html">多核对齐切分</a></li><li>6.3.3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10014.html">多核非对齐切分</a></li><li>6.3.3.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10015.html">异步场景处理</a></li><li>6.3.3.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10017.html">矩阵乘输出的量化/反量化</a></li><li>6.3.3.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10018.html">矩阵乘输出的Channel拆分</a></li><li>6.3.3.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10019.html">矩阵向量乘</a></li><li>6.3.3.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10021.html">4:2稀疏矩阵乘</a></li><li>6.3.3.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10024.html">TSCM输入的矩阵乘</a></li><li>6.3.3.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10026.html">矩阵乘输出的N方向对齐</a></li><li>6.3.3.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10027.html">单次矩阵乘局部输出</a></li><li>6.3.3.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_10028.html">AIC和AIV独立运行机制</a></li><li>6.3.3.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0041.html">Batch Matmul基础功能</a></li></ul></li></ul></li><li>6.4. 矩阵编程（基础API）
<ul><li>6.4.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_00006.html">耦合架构</a></li><li>6.4.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_00007.html">分离架构</a></li></ul></li><li>6.5. 融合算子编程
<ul><li>6.5.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0049.html">基础知识</a></li><li>6.5.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0050.html">算子实现</a></li></ul></li><li>6.6. Kernel直调算子开发
<ul><li>6.6.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0052.html">概述</a></li><li>6.6.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0056.html">Kernel直调</a></li><li>6.6.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0057.html">Pybind调用</a></li></ul></li><li>6.7. 工程化算子开发
<ul><li>6.7.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0059.html">概述</a></li><li>6.7.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0060.html">创建算子工程</a></li><li>6.7.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0062.html">算子原型定义</a></li><li>6.7.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0063.html">Kernel侧算子实现</a></li><li>6.7.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0064.html">Host侧tiling实现</a></li><li>6.7.6. 算子包编译
<ul><li>6.7.6.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0068.html">算子工程编译</a></li><li>6.7.6.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0069.html">算子包部署</a></li></ul></li><li>6.7.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_00012.html">算子动态库编译</a></li><li>6.7.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0070.html">单算子API调用</a></li></ul></li></ul></li></ol></li><li><ol start="7"><li>算子调试调优
<ul><li>7.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0072.html">孪生调试简介</a></li><li>7.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0073.html">CPU域调试</a></li><li>7.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0075.html">NPU域调试调优</a></li></ul></li></ol></li><li><ol start="8"><li>算子入图（GE图）开发
<ul><li>8.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0077.html">概述</a></li><li>8.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0078.html">开发流程</a></li><li>8.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_00014.html">Tiling下沉</a></li><li>8.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0079.html">图编译和图执行</a></li></ul></li></ol></li><li><ol start="9"><li>AI框架算子适配
<ul><li>9.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0081.html">概述</a></li><li>9.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0082.html">PyTorch框架</a></li><li>9.3. ONNX框架
<ul><li>9.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0086.html">适配插件开发</a></li><li>9.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0087.html">调用样例</a></li></ul></li><li>9.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0088.html">TensorFlow框架</a></li></ul></li></ol></li><li><ol start="10"><li>概念原理和术语
<ul><li>10.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_00013.html">术语表</a></li><li>10.2. 神经网络和算子
<ul><li>10.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0098.html">算子基本概念</a></li><li>10.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0099.html">数据排布格式</a></li></ul></li><li>10.3. 硬件架构与数据处理原理
<ul><li>10.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0008.html">基本架构</a></li><li>10.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0009.html">计算单元</a></li><li>10.3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0010.html">存储单元</a></li><li>10.3.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0011.html">控制单元</a></li></ul></li><li>10.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_00015.html">编程模型设计原理</a></li><li>10.5. 性能优化技术原理
<ul><li>10.5.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0090.html">DoubleBuffer</a></li></ul></li></ul></li></ol></li><li><ol start="11"><li>常用操作
<ul><li>11.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_00005.html">如何开发动态输入算子</a></li><li>11.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0100.html">如何在矢量编程时使能Vector Core</a></li><li>11.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0095.html">如何开发通算融合算子</a></li><li>11.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0022.html">如何使用Tensor高维切分计算API</a></li><li>11.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0023.html">如何使用归约指令</a></li><li>11.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0024.html">如何使用掩码操作API</a></li><li>11.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0092.html">如何使用workspace</a></li><li>11.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_00018.html">如何进行Tiling调测</a></li><li>11.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0093.html">如何使用SPM Buffer</a></li><li>11.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_00019.html">如何使用更底层编程方式提升算子性能</a></li><li>11.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_00020.html">如何使用Tensor原地操作提升算子性能</a></li></ul></li></ol></li><li><ol start="12"><li>附录
<ul><li>12.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0101.html">简易自定义算子工程</a></li><li>12.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0102.html">show<em>kernel</em>debug_data工具</a></li><li>12.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0103.html">msobjdump工具</a></li></ul></li></ol></li><li><ol start="13"><li>FAQ
<ul><li>13.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0106.html">核函数运行验证时算子存在精度问题</a></li><li>13.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0107.html">运行验证时AllocTensor/FreeTensor失败</a></li><li>13.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0108.html">kernel侧获取Tiling信息不正确</a></li><li>13.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0109.html">Kernel编译时报错“error: out of jump/jumpc imm range”</a></li><li>13.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0110.html">使用跨版本的自定义算子包时，含有Matmul高阶API的算子存在编译或执行报错</a></li><li>13.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0111.html">含有Matmul高阶API的算子精度问题</a></li><li>13.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_0112.html">算子工程编译时出现文件名过长报错</a></li><li>13.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_00003.html">调用算子时出现无法打开config.ini的报错</a></li><li>13.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/Ascendcopdevg/atlas_ascendc_10_00004.html">算子包部署时出现权限不足报错</a></li></ul></li></ol></li></ul><h2 id="ascend-c-api">Ascend C API</h2><ul><li><ol start="1"><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0003.html">Ascend C API列表</a></li></ol></li><li><ol start="2"><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0004.html">通用约束</a></li></ol></li><li><ol start="3"><li>数据类型定义
<ul><li>3.1. LocalTensor
<ul><li>3.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00100.html">简介</a></li><li>3.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00101.html">构造函数</a></li><li>3.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00102.html">SetValue</a></li><li>3.1.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00103.html">GetValue</a></li><li>3.1.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00104.html">operator[]</a></li><li>3.1.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00105.html">operator()</a></li><li>3.1.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00106.html">SetSize</a></li><li>3.1.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00107.html">GetSize</a></li><li>3.1.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00108.html">SetUserTag</a></li><li>3.1.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00109.html">GetUserTag</a></li><li>3.1.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00110.html">ReinterpretCast</a></li><li>3.1.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00111.html">GetPhyAddr</a></li><li>3.1.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00112.html">GetPosition</a></li><li>3.1.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00113.html">GetLength</a></li><li>3.1.15. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00114.html">SetShapeInfo</a></li><li>3.1.16. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00115.html">GetShapeInfo</a></li><li>3.1.17. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00116.html">SetAddrWithOffset</a></li><li>3.1.18. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00117.html">SetBufferLen</a></li><li>3.1.19. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00118.html">ToFile</a></li><li>3.1.20. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00119.html">Print</a></li></ul></li><li>3.2. GlobalTensor
<ul><li>3.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00022.html">简介</a></li><li>3.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00023.html">构造函数</a></li><li>3.2.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00024.html">SetGlobalBuffer</a></li><li>3.2.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00025.html">GetPhyAddr</a></li><li>3.2.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00026.html">GetValue</a></li><li>3.2.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00027.html">operator()</a></li><li>3.2.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00028.html">SetValue</a></li><li>3.2.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00029.html">GetSize</a></li><li>3.2.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00030.html">operator[]</a></li><li>3.2.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00031.html">SetShapeInfo</a></li><li>3.2.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00032.html">GetShapeInfo</a></li><li>3.2.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00033.html">SetL2CacheHint</a></li></ul></li><li>3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0008.html">ShapeInfo</a></li><li>3.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0009.html">ListTensorDesc</a></li><li>3.5. TensorDesc
<ul><li>3.5.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00062.html">简介</a></li><li>3.5.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00063.html">构造和析构函数</a></li><li>3.5.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00064.html">SetShapeAddr</a></li><li>3.5.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00065.html">GetDim</a></li><li>3.5.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00066.html">GetIndex</a></li><li>3.5.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00067.html">GetShape</a></li><li>3.5.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00068.html">GetDataPtr</a></li><li>3.5.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00069.html">GetDataObj</a></li></ul></li><li>3.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0011.html">TensorTrait</a></li><li>3.7. Layout
<ul><li>3.7.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00077.html">简介</a></li><li>3.7.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00078.html">构造函数</a></li><li>3.7.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00079.html">layout</a></li><li>3.7.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00080.html">GetShape</a></li><li>3.7.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00081.html">GetStride</a></li><li>3.7.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00082.html">MakeShape</a></li><li>3.7.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00083.html">MakeStride</a></li><li>3.7.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00084.html">MakeLayout</a></li><li>3.7.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00085.html">is_layout</a></li></ul></li><li>3.8. LocalMemAllocator
<ul><li>3.8.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00096.html">简介</a></li><li>3.8.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00097.html">构造函数</a></li><li>3.8.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00098.html">GetCurAddr</a></li><li>3.8.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00099.html">Alloc</a></li></ul></li><li>3.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0012.html">UnaryRepeatParams</a></li><li>3.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0013.html">BinaryRepeatParams</a></li></ul></li></ol></li><li><ol start="4"><li>基础API
<ul><li>4.1. 标量计算
<ul><li>4.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0016.html">ScalarGetCountOfValue</a></li><li>4.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0017.html">ScalarCountLeadingZero</a></li><li>4.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0018.html">ScalarCast</a></li><li>4.1.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0019.html">CountBitsCntSameAsSignBit</a></li><li>4.1.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0020.html">ScalarGetSFFValue</a></li><li>4.1.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0021.html">ToBfloat16</a></li><li>4.1.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0022.html">ToFloat</a></li></ul></li><li>4.2. 矢量计算
<ul><li>4.2.1. 单目指令
<ul><li>4.2.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0025.html">Exp</a></li><li>4.2.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0026.html">Ln</a></li><li>4.2.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0027.html">Abs</a></li><li>4.2.1.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0028.html">Reciprocal</a></li><li>4.2.1.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0029.html">Sqrt</a></li><li>4.2.1.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0030.html">Rsqrt</a></li><li>4.2.1.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0031.html">Not</a></li><li>4.2.1.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0032.html">Relu</a></li><li>4.2.1.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0221.html">VectorPadding(ISASI)</a></li><li>4.2.1.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0033.html">更多样例</a></li></ul></li><li>4.2.2. 双目指令
<ul><li>4.2.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0035.html">Add</a></li><li>4.2.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0036.html">Sub</a></li><li>4.2.2.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0037.html">Mul</a></li><li>4.2.2.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0038.html">Div</a></li><li>4.2.2.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0039.html">Max</a></li><li>4.2.2.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0040.html">Min</a></li><li>4.2.2.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0041.html">And</a></li><li>4.2.2.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0042.html">Or</a></li><li>4.2.2.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0043.html">AddRelu</a></li><li>4.2.2.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0044.html">AddReluCast</a></li><li>4.2.2.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0045.html">AddDeqRelu</a></li><li>4.2.2.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0046.html">SubRelu</a></li><li>4.2.2.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0047.html">SubReluCast</a></li><li>4.2.2.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0048.html">MulAddDst</a></li><li>4.2.2.15. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0049.html">MulCast</a></li><li>4.2.2.16. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0050.html">FusedMulAdd</a></li><li>4.2.2.17. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0051.html">FusedMulAddRelu</a></li><li>4.2.2.18. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0222.html">BilinearInterpolation(ISASI)</a></li><li>4.2.2.19. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0052.html">更多样例</a></li></ul></li><li>4.2.3. 标量双目指令
<ul><li>4.2.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0054.html">Adds</a></li><li>4.2.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0055.html">Muls</a></li><li>4.2.3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0056.html">Maxs</a></li><li>4.2.3.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0057.html">Mins</a></li><li>4.2.3.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0058.html">ShiftLeft</a></li><li>4.2.3.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0059.html">ShiftRight</a></li><li>4.2.3.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0060.html">LeakyRelu</a></li><li>4.2.3.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0061.html">更多样例</a></li></ul></li><li>4.2.4. 标量三目指令
<ul><li>4.2.4.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0063.html">Axpy</a></li><li>4.2.4.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0064.html">更多样例</a></li></ul></li><li>4.2.5. 比较指令
<ul><li>4.2.5.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0066.html">Compare</a></li><li>4.2.5.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0067.html">Compare（结果存入寄存器）</a></li><li>4.2.5.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0068.html">CompareScalar</a></li><li>4.2.5.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0223.html">GetCmpMask(ISASI)</a></li><li>4.2.5.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0224.html">SetCmpMask(ISASI)</a></li></ul></li><li>4.2.6. 选择指令
<ul><li>4.2.6.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0070.html">Select</a></li><li>4.2.6.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0071.html">GatherMask</a></li></ul></li><li>4.2.7. 精度转换指令
<ul><li>4.2.7.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0073.html">Cast</a></li><li>4.2.7.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0074.html">CastDeq</a></li></ul></li><li>4.2.8. 归约指令
<ul><li>4.2.8.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0076.html">ReduceMax</a></li><li>4.2.8.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0077.html">ReduceMin</a></li><li>4.2.8.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0078.html">ReduceSum</a></li><li>4.2.8.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0079.html">WholeReduceMax</a></li><li>4.2.8.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0080.html">WholeReduceMin</a></li><li>4.2.8.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0081.html">WholeReduceSum</a></li><li>4.2.8.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0082.html">BlockReduceMax</a></li><li>4.2.8.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0083.html">BlockReduceMin</a></li><li>4.2.8.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0084.html">BlockReduceSum</a></li><li>4.2.8.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0085.html">PairReduceSum</a></li><li>4.2.8.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0086.html">RepeatReduceSum</a></li><li>4.2.8.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0225.html">GetAccVal(ISASI)</a></li><li>4.2.8.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0226.html">GetReduceMaxMinCount(ISASI)</a></li></ul></li><li>4.2.9. 数据转换
<ul><li>4.2.9.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0199.html">Transpose</a></li><li>4.2.9.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0200.html">TransDataTo5HD</a></li></ul></li><li>4.2.10. 数据填充
<ul><li>4.2.10.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0088.html">Duplicate</a></li><li>4.2.10.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0089.html">Brcb</a></li><li>4.2.10.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0090.html">CreateVecIndex</a></li></ul></li><li>4.2.11. 排序组合(ISASI)
<ul><li>4.2.11.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0227.html">ProposalConcat</a></li><li>4.2.11.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0228.html">ProposalExtract</a></li><li>4.2.11.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0229.html">RpSort16</a></li><li>4.2.11.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0230.html">MrgSort4</a></li><li>4.2.11.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0231.html">Sort32</a></li><li>4.2.11.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0232.html">MrgSort</a></li><li>4.2.11.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0233.html">GetMrgSortResult</a></li></ul></li><li>4.2.12. 数据分散/数据收集
<ul><li>4.2.12.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0092.html">Gather</a></li><li>4.2.12.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0234.html">Gatherb(ISASI)</a></li><li>4.2.12.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0235.html">Scatter(ISASI)</a></li></ul></li><li>4.2.13. 掩码操作
<ul><li>4.2.13.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0094.html">SetMaskCount</a></li><li>4.2.13.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0095.html">SetMaskNorm</a></li><li>4.2.13.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0096.html">SetVectorMask</a></li><li>4.2.13.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0097.html">ResetMask</a></li></ul></li><li>4.2.14. 量化设置
<ul><li>4.2.14.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0099.html">SetDeqScale</a></li></ul></li></ul></li><li>4.3. 数据搬运
<ul><li>4.3.1. DataCopy
<ul><li>4.3.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0102.html">普通数据搬运</a></li><li>4.3.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0103.html">增强数据搬运</a></li><li>4.3.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0104.html">切片数据搬运</a></li><li>4.3.1.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0105.html">随路格式转换</a></li></ul></li><li>4.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0106.html">Copy</a></li><li>4.3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0265.html">DataCopyPad(ISASI)</a></li><li>4.3.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0266.html">SetPadValue(ISASI)</a></li><li>4.3.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0252.html">SetFixPipeConfig(ISASI)</a></li><li>4.3.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0253.html">SetFixpipeNz2ndFlag(ISASI)</a></li><li>4.3.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0254.html">SetFixpipePreQuantFlag(ISASI)</a></li><li>4.3.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0255.html">SetFixPipeClipRelu(ISASI)</a></li><li>4.3.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0256.html">SetFixPipeAddr(ISASI)</a></li></ul></li><li>4.4. 内存管理与同步控制
<ul><li>4.4.1. TPipe
<ul><li>4.4.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0109.html">TPipe构造函数</a></li><li>4.4.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0111.html">Init</a></li><li>4.4.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0112.html">Destroy</a></li><li>4.4.1.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0110.html">InitBuffer</a></li><li>4.4.1.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0113.html">Reset</a></li><li>4.4.1.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0114.html">AllocEventID</a></li><li>4.4.1.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0115.html">ReleaseEventID</a></li><li>4.4.1.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0116.html">FetchEventID</a></li><li>4.4.1.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0117.html">GetBaseAddr</a></li><li>4.4.1.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0119.html">InitBufPool</a></li></ul></li><li>4.4.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0120.html">GetTPipePtr</a></li><li>4.4.3. TBufPool
<ul><li>4.4.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0122.html">简介</a></li><li>4.4.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0123.html">构造函数</a></li><li>4.4.3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0124.html">InitBufPool</a></li><li>4.4.3.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0125.html">InitBuffer</a></li><li>4.4.3.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0126.html">Reset</a></li></ul></li><li>4.4.4. 自定义TBufPool
<ul><li>4.4.4.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0128.html">EXTERN<em>IMPL</em>BUFPOOL宏</a></li><li>4.4.4.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0129.html">Reset</a></li><li>4.4.4.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0130.html">Init</a></li><li>4.4.4.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0131.html">GetBufHandle</a></li><li>4.4.4.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0132.html">SetCurAddr</a></li><li>4.4.4.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0133.html">GetCurAddr</a></li><li>4.4.4.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0134.html">SetCurBufSize</a></li><li>4.4.4.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0135.html">GetCurBufSize</a></li></ul></li><li>4.4.5. TQue
<ul><li>4.4.5.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0137.html">简介</a></li><li>4.4.5.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0138.html">AllocTensor</a></li><li>4.4.5.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0139.html">FreeTensor</a></li><li>4.4.5.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0140.html">EnQue</a></li><li>4.4.5.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0141.html">DeQue</a></li><li>4.4.5.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0142.html">VacantInQue</a></li><li>4.4.5.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0143.html">HasTensorInQue</a></li><li>4.4.5.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0144.html">GetTensorCountInQue</a></li><li>4.4.5.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0145.html">HasIdleBuffer</a></li></ul></li><li>4.4.6. TQueBind
<ul><li>4.4.6.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0147.html">简介</a></li><li>4.4.6.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0148.html">构造函数</a></li><li>4.4.6.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0149.html">AllocTensor</a></li><li>4.4.6.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0150.html">FreeTensor</a></li><li>4.4.6.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0151.html">EnQue</a></li><li>4.4.6.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0152.html">DeQue</a></li><li>4.4.6.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0153.html">VacantInQue</a></li><li>4.4.6.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0154.html">HasTensorInQue</a></li><li>4.4.6.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0155.html">GetTensorCountInQue</a></li><li>4.4.6.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0156.html">HasIdleBuffer</a></li><li>4.4.6.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0157.html">FreeAllEvent</a></li><li>4.4.6.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0158.html">InitBufHandle</a></li><li>4.4.6.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0159.html">InitStartBufHandle</a></li></ul></li><li>4.4.7. TBuf
<ul><li>4.4.7.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0161.html">TBuf简介</a></li><li>4.4.7.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0162.html">构造函数</a></li><li>4.4.7.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0163.html">Get</a></li><li>4.4.7.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0164.html">GetWithOffset</a></li></ul></li><li>4.4.8. SPM Buffer
<ul><li>4.4.8.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0166.html">InitSpmBuffer</a></li><li>4.4.8.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0167.html">WriteSpmBuffer</a></li><li>4.4.8.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0168.html">ReadSpmBuffer</a></li></ul></li><li>4.4.9. workspace
<ul><li>4.4.9.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0170.html">GetSysWorkSpacePtr</a></li><li>4.4.9.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0171.html">SetSysWorkSpace</a></li><li>4.4.9.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0172.html">GetUserWorkspace</a></li></ul></li><li>4.4.10. 核内同步
<ul><li>4.4.10.1. TQueSync
<ul><li>4.4.10.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0179.html">同步控制简介</a></li><li>4.4.10.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0180.html">模板参数</a></li><li>4.4.10.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0181.html">SetFlag/WaitFlag</a></li></ul></li><li>4.4.10.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0270.html">SetFlag/WaitFlag(ISASI)</a></li><li>4.4.10.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0271.html">PipeBarrier(ISASI)</a></li><li>4.4.10.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0272.html">DataSyncBarrier(ISASI)</a></li></ul></li><li>4.4.11. 核间同步
<ul><li>4.4.11.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0202.html">IBSet</a></li><li>4.4.11.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0203.html">IBWait</a></li><li>4.4.11.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0204.html">SyncAll</a></li><li>4.4.11.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0273.html">CrossCoreSetFlag(ISASI)</a></li><li>4.4.11.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0274.html">CrossCoreWaitFlag(ISASI)</a></li><li>4.4.11.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0206.html">InitDetermineComputeWorkspace</a></li><li>4.4.11.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0208.html">NotifyNextBlock</a></li><li>4.4.11.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0207.html">WaitPreBlock</a></li></ul></li><li>4.4.12. 任务间同步
<ul><li>4.4.12.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00087.html">SetNextTaskStart</a></li><li>4.4.12.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00088.html">WaitPreTaskEnd</a></li></ul></li><li>4.4.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0174.html">TPosition</a></li></ul></li><li>4.5. 缓存处理
<ul><li>4.5.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0176.html">DataCachePreload</a></li><li>4.5.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0177.html">DataCacheCleanAndInvalid</a></li><li>4.5.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0276.html">ICachePreLoad(ISASI)</a></li><li>4.5.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0277.html">GetICachePreloadStatus(ISASI)</a></li></ul></li><li>4.6. 系统变量访问
<ul><li>4.6.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0184.html">GetBlockNum</a></li><li>4.6.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0185.html">GetBlockIdx</a></li><li>4.6.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0186.html">GetDataBlockSizeInBytes</a></li><li>4.6.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0187.html">GetArchVersion</a></li><li>4.6.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0188.html">GetTaskRation</a></li><li>4.6.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00094.html">InitSocState</a></li><li>4.6.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0279.html">GetProgramCounter(ISASI)</a></li><li>4.6.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0280.html">GetSubBlockNum(ISASI)</a></li><li>4.6.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0281.html">GetSubBlockIdx(ISASI)</a></li><li>4.6.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0282.html">GetSystemCycle(ISASI)</a></li></ul></li><li>4.7. 原子操作
<ul><li>4.7.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0210.html">SetAtomicAdd</a></li><li>4.7.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0211.html">SetAtomicType</a></li><li>4.7.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0212.html">SetAtomicNone</a></li><li>4.7.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0284.html">SetAtomicMax(ISASI)</a></li><li>4.7.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0285.html">SetAtomicMin(ISASI)</a></li><li>4.7.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0286.html">SetStoreAtomicConfig(ISASI)</a></li><li>4.7.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0287.html">GetStoreAtomicConfig(ISASI)</a></li></ul></li><li>4.8. 矩阵计算(ISASI)
<ul><li>4.8.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0237.html">InitConstValue</a></li><li>4.8.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0238.html">LoadData</a></li><li>4.8.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0239.html">LoadDataWithTranspose</a></li><li>4.8.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0240.html">SetAippFunctions</a></li><li>4.8.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0241.html">LoadImageToLocal</a></li><li>4.8.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0242.html">LoadUnzipIndex</a></li><li>4.8.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0243.html">LoadDataUnzip</a></li><li>4.8.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0244.html">LoadDataWithSparse</a></li><li>4.8.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0245.html">SetFmatrix</a></li><li>4.8.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0246.html">SetLoadDataBoundary</a></li><li>4.8.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0247.html">SetLoadDataRepeat</a></li><li>4.8.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0248.html">SetLoadDataPaddingValue</a></li><li>4.8.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0249.html">Mmad</a></li><li>4.8.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0250.html">MmadWithSparse</a></li><li>4.8.15. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0251.html">Fixpipe</a></li><li>4.8.16. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0258.html">SetHF32Mode</a></li><li>4.8.17. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0259.html">SetHF32TransMode</a></li><li>4.8.18. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0260.html">SetMMLayoutTransform</a></li><li>4.8.19. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0261.html">CheckLocalMemoryIA</a></li><li>4.8.20. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0262.html">Conv2D</a></li><li>4.8.21. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0263.html">Gemm</a></li></ul></li><li>4.9. 资源管理(ISASI)
<ul><li>4.9.1. CubeResGroupHandle
<ul><li>4.9.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0290.html">使用说明</a></li><li>4.9.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0291.html">CubeResGroupHandle构造函数</a></li><li>4.9.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0300.html">CreateCubeResGroup</a></li><li>4.9.1.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0292.html">AssignQueue</a></li><li>4.9.1.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0293.html">AllocMessage</a></li><li>4.9.1.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0294.html">PostMessage</a></li><li>4.9.1.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0295.html">PostFakeMsg</a></li><li>4.9.1.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0296.html">SetQuit</a></li><li>4.9.1.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0297.html">Wait</a></li><li>4.9.1.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0298.html">FreeMessage</a></li><li>4.9.1.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0299.html">SetSkipMsg</a></li></ul></li><li>4.9.2. GroupBarrier
<ul><li>4.9.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0302.html">使用说明</a></li><li>4.9.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0303.html">GroupBarrier构造函数</a></li><li>4.9.2.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0304.html">Arrive</a></li><li>4.9.2.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0305.html">Wait</a></li><li>4.9.2.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0306.html">GetWorkspaceLen</a></li></ul></li><li>4.9.3. KfcWorkspace
<ul><li>4.9.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0308.html">构造函数与析构函数</a></li><li>4.9.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0309.html">UpdateKfcWorkspace</a></li><li>4.9.3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0310.html">GetKfcWorkspace</a></li></ul></li></ul></li><li>4.10. Kernel Tiling
<ul><li>4.10.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0214.html">GET<em>TILING</em>DATA</a></li><li>4.10.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0215.html">GET<em>TILING</em>DATA<em>WITH</em>STRUCT</a></li><li>4.10.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0216.html">GET<em>TILING</em>DATA_MEMBER</a></li><li>4.10.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0217.html">TILING<em>KEY</em>IS</a></li><li>4.10.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00003.html">REGISTER<em>TILING</em>DEFAULT</a></li><li>4.10.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00004.html">REGISTER<em>TILING</em>FOR_TILINGKEY</a></li><li>4.10.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0218.html">设置kernel类型</a></li></ul></li></ul></li></ol></li><li><ol start="5"><li>高阶API
<ul><li>5.1. 数学库
<ul><li>5.1.1. Tanh
<ul><li>5.1.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0492.html">Tanh</a></li><li>5.1.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0493.html">GetTanhMaxMinTmpSize</a></li><li>5.1.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0494.html">GetTanhTmpBufferFactorSize</a></li></ul></li><li>5.1.2. Asin
<ul><li>5.1.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0496.html">Asin</a></li><li>5.1.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0497.html">GetAsinMaxMinTmpSize</a></li><li>5.1.2.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0498.html">GetAsinTmpBufferFactorSize</a></li></ul></li><li>5.1.3. Sin
<ul><li>5.1.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0500.html">Sin</a></li><li>5.1.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0501.html">GetSinMaxMinTmpSize</a></li><li>5.1.3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0502.html">GetSinTmpBufferFactorSize</a></li></ul></li><li>5.1.4. Acos
<ul><li>5.1.4.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0504.html">Acos</a></li><li>5.1.4.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0505.html">GetAcosMaxMinTmpSize</a></li><li>5.1.4.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0506.html">GetAcosTmpBufferFactorSize</a></li></ul></li><li>5.1.5. Cos
<ul><li>5.1.5.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0508.html">Cos</a></li><li>5.1.5.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0509.html">GetCosMaxMinTmpSize</a></li><li>5.1.5.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0510.html">GetCosTmpBufferFactorSize</a></li></ul></li><li>5.1.6. Log
<ul><li>5.1.6.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0512.html">Log</a></li><li>5.1.6.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0513.html">GetLogMaxMinTmpSize</a></li><li>5.1.6.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0514.html">GetLogTmpBufferFactorSize</a></li></ul></li><li>5.1.7. Atan
<ul><li>5.1.7.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0516.html">Atan</a></li><li>5.1.7.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0517.html">GetAtanMaxMinTmpSize</a></li><li>5.1.7.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0518.html">GetAtanTmpBufferFactorSize</a></li></ul></li><li>5.1.8. Power
<ul><li>5.1.8.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0520.html">Power</a></li><li>5.1.8.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0521.html">GetPowerMaxMinTmpSize</a></li><li>5.1.8.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0522.html">GetPowerTmpBufferFactorSize</a></li></ul></li><li>5.1.9. Sinh
<ul><li>5.1.9.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0524.html">Sinh</a></li><li>5.1.9.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0525.html">GetSinhMaxMinTmpSize</a></li><li>5.1.9.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0526.html">GetSinhTmpBufferFactorSize</a></li></ul></li><li>5.1.10. Cosh
<ul><li>5.1.10.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0528.html">Cosh</a></li><li>5.1.10.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0529.html">GetCoshMaxMinTmpSize</a></li><li>5.1.10.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0530.html">GetCoshTmpBufferFactorSize</a></li></ul></li><li>5.1.11. Tan
<ul><li>5.1.11.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0532.html">Tan</a></li><li>5.1.11.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0533.html">GetTanMaxMinTmpSize</a></li><li>5.1.11.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0534.html">GetTanTmpBufferFactorSize</a></li></ul></li><li>5.1.12. Trunc
<ul><li>5.1.12.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0536.html">Trunc</a></li><li>5.1.12.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0537.html">GetTruncMaxMinTmpSize</a></li><li>5.1.12.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0538.html">GetTruncTmpBufferFactorSize</a></li></ul></li><li>5.1.13. Frac
<ul><li>5.1.13.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0540.html">Frac</a></li><li>5.1.13.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0541.html">GetFracMaxMinTmpSize</a></li><li>5.1.13.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0542.html">GetFracTmpBufferFactorSize</a></li></ul></li><li>5.1.14. Erf
<ul><li>5.1.14.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0544.html">Erf</a></li><li>5.1.14.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0545.html">GetErfMaxMinTmpSize</a></li><li>5.1.14.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0546.html">GetErfTmpBufferFactorSize</a></li></ul></li><li>5.1.15. Erfc
<ul><li>5.1.15.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0548.html">Erfc</a></li><li>5.1.15.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0549.html">GetErfcMaxMinTmpSize</a></li><li>5.1.15.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0550.html">GetErfcTmpBufferFactorSize</a></li></ul></li><li>5.1.16. Sign
<ul><li>5.1.16.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0552.html">Sign</a></li><li>5.1.16.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0553.html">GetSignMaxMinTmpSize</a></li><li>5.1.16.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0554.html">GetSignTmpBufferFactorSize</a></li></ul></li><li>5.1.17. Atanh
<ul><li>5.1.17.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0556.html">Atanh</a></li><li>5.1.17.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0557.html">GetAtanhMaxMinTmpSize</a></li><li>5.1.17.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0558.html">GetAtanhTmpBufferFactorSize</a></li></ul></li><li>5.1.18. Asinh
<ul><li>5.1.18.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0560.html">Asinh</a></li><li>5.1.18.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0561.html">GetAsinhMaxMinTmpSize</a></li><li>5.1.18.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0562.html">GetAsinhTmpBufferFactorSize</a></li></ul></li><li>5.1.19. Acosh
<ul><li>5.1.19.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0564.html">Acosh</a></li><li>5.1.19.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0565.html">GetAcoshMaxMinTmpSize</a></li><li>5.1.19.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0566.html">GetAcoshTmpBufferFactorSize</a></li></ul></li><li>5.1.20. Floor
<ul><li>5.1.20.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0568.html">Floor</a></li><li>5.1.20.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0569.html">GetFloorMaxMinTmpSize</a></li><li>5.1.20.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0570.html">GetFloorTmpBufferFactorSize</a></li></ul></li><li>5.1.21. Ceil
<ul><li>5.1.21.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0572.html">Ceil</a></li><li>5.1.21.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0573.html">GetCeilMaxMinTmpSize</a></li><li>5.1.21.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0574.html">GetCeilTmpBufferFactorSize</a></li></ul></li><li>5.1.22. Clamp
<ul><li>5.1.22.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0576.html">ClampMax</a></li><li>5.1.22.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0577.html">ClampMin</a></li><li>5.1.22.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0578.html">GetClampMaxMinTmpSize</a></li><li>5.1.22.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0579.html">GetClampTmpBufferFactorSize</a></li></ul></li><li>5.1.23. Round
<ul><li>5.1.23.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0581.html">Round</a></li><li>5.1.23.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0582.html">GetRoundMaxMinTmpSize</a></li><li>5.1.23.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0583.html">GetRoundTmpBufferFactorSize</a></li></ul></li><li>5.1.24. Axpy
<ul><li>5.1.24.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0585.html">Axpy</a></li><li>5.1.24.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0586.html">GetAxpyMaxMinTmpSize</a></li><li>5.1.24.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0587.html">GetAxpyTmpBufferFactorSize</a></li></ul></li><li>5.1.25. Exp
<ul><li>5.1.25.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0589.html">Exp</a></li><li>5.1.25.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0590.html">GetExpMaxMinTmpSize</a></li><li>5.1.25.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0591.html">GetExpTmpBufferFactorSize</a></li></ul></li><li>5.1.26. Lgamma
<ul><li>5.1.26.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0593.html">Lgamma</a></li><li>5.1.26.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0594.html">GetLgammaMaxMinTmpSize</a></li><li>5.1.26.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0595.html">GetLgammaTmpBufferFactorSize</a></li></ul></li><li>5.1.27. Digamma
<ul><li>5.1.27.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0597.html">Digamma</a></li><li>5.1.27.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0598.html">GetDigammaMaxMinTmpSize</a></li><li>5.1.27.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0599.html">GetDigammaTmpBufferFactorSize</a></li></ul></li><li>5.1.28. Xor
<ul><li>5.1.28.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0601.html">Xor</a></li><li>5.1.28.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0602.html">GetXorMaxMinTmpSize</a></li><li>5.1.28.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0603.html">GetXorTmpBufferFactorSize</a></li></ul></li><li>5.1.29. CumSum
<ul><li>5.1.29.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0605.html">CumSum</a></li><li>5.1.29.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0606.html">GetCumSumMaxMinTmpSize</a></li></ul></li><li>5.1.30. Fmod
<ul><li>5.1.30.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0608.html">Fmod</a></li><li>5.1.30.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0609.html">GetFmodMaxMinTmpSize</a></li><li>5.1.30.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10035.html">GetFmodTmpBufferFactorSize</a></li></ul></li><li>5.1.31. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0611.html">更多样例</a></li></ul></li><li>5.2. Matmul
<ul><li>5.2.1. Matmul
<ul><li>5.2.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0614.html">使用说明</a></li><li>5.2.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0615.html">Matmul模板参数</a></li><li>5.2.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0616.html">MatmulConfig</a></li><li>5.2.1.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0618.html">MatmulCallBackFunc</a></li><li>5.2.1.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0619.html">MatmulPolicy</a></li><li>5.2.1.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10180.html">Matmul特性场景</a></li><li>5.2.1.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0621.html">GetNormalConfig</a></li><li>5.2.1.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0622.html">GetMDLConfig</a></li><li>5.2.1.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0623.html">GetSpecialMDLConfig</a></li><li>5.2.1.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0624.html">GetIBShareNormConfig</a></li><li>5.2.1.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0625.html">GetBasicConfig</a></li><li>5.2.1.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0626.html">GetSpecialBasicConfig</a></li><li>5.2.1.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0627.html">GetMMConfig</a></li><li>5.2.1.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0628.html">REGIST<em>MATMUL</em>OBJ</a></li><li>5.2.1.15. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0630.html">Init</a></li><li>5.2.1.16. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0631.html">SetTensorA</a></li><li>5.2.1.17. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0632.html">SetTensorB</a></li><li>5.2.1.18. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0635.html">SetBias</a></li><li>5.2.1.19. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0636.html">DisableBias</a></li><li>5.2.1.20. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0637.html">GetBatchTensorC</a></li><li>5.2.1.21. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0638.html">Iterate</a></li><li>5.2.1.22. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0639.html">GetTensorC</a></li><li>5.2.1.23. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0640.html">IterateAll</a></li><li>5.2.1.24. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0641.html">WaitIterateAll</a></li><li>5.2.1.25. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0642.html">IterateBatch</a></li><li>5.2.1.26. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0643.html">WaitIterateBatch</a></li><li>5.2.1.27. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0644.html">IterateNBatch</a></li><li>5.2.1.28. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0645.html">End</a></li><li>5.2.1.29. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0646.html">SetHF32</a></li><li>5.2.1.30. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0647.html">SetTail</a></li><li>5.2.1.31. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0648.html">SetBatchNum</a></li><li>5.2.1.32. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0649.html">SetQuantScalar</a></li><li>5.2.1.33. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0650.html">SetQuantVector</a></li><li>5.2.1.34. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0651.html">SetOrgShape</a></li><li>5.2.1.35. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0652.html">SetSingleShape</a></li><li>5.2.1.36. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0653.html">SetLocalWorkspace</a></li><li>5.2.1.37. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0654.html">SetWorkspace</a></li><li>5.2.1.38. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0655.html">SetAntiQuantScalar</a></li><li>5.2.1.39. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0656.html">SetAntiQuantVector</a></li><li>5.2.1.40. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0659.html">WaitGetTensorC</a></li><li>5.2.1.41. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0660.html">GetOffsetC</a></li><li>5.2.1.42. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0661.html">AsyncGetTensorC</a></li><li>5.2.1.43. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0664.html">SetUserDefInfo</a></li><li>5.2.1.44. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0665.html">SetSelfDefineData</a></li><li>5.2.1.45. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0666.html">GetMatmulApiTiling</a></li><li>5.2.1.46. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0667.html">ClearBias</a></li><li>5.2.1.47. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0668.html">GetBatchC</a></li><li>5.2.1.48. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10112.html">SetSparseIndex</a></li></ul></li><li>5.2.2. Matmul Tiling
<ul><li>5.2.2.1. Matmul Tiling类
<ul><li>5.2.2.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0671.html">使用说明</a></li><li>5.2.2.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0672.html">构造函数</a></li><li>5.2.2.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0673.html">TCubeTiling结构体</a></li><li>5.2.2.1.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0674.html">SetAType</a></li><li>5.2.2.1.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0675.html">SetBType</a></li><li>5.2.2.1.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0676.html">SetCType</a></li><li>5.2.2.1.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0677.html">SetBiasType</a></li><li>5.2.2.1.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0678.html">SetSingleShape</a></li><li>5.2.2.1.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0679.html">SetShape</a></li><li>5.2.2.1.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0680.html">SetOrgShape</a></li><li>5.2.2.1.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0681.html">SetFixSplit</a></li><li>5.2.2.1.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0682.html">EnableMultiCoreSplitK</a></li><li>5.2.2.1.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0683.html">EnableBias</a></li><li>5.2.2.1.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0684.html">SetBufferSpace</a></li><li>5.2.2.1.15. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0685.html">SetTraverse</a></li><li>5.2.2.1.16. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0686.html">SetMadType</a></li><li>5.2.2.1.17. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0687.html">SetSplitRange</a></li><li>5.2.2.1.18. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0688.html">SetDoubleBuffer</a></li><li>5.2.2.1.19. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0689.html">GetBaseM</a></li><li>5.2.2.1.20. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0690.html">GetBaseN</a></li><li>5.2.2.1.21. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0691.html">GetBaseK</a></li><li>5.2.2.1.22. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0692.html">GetTiling</a></li><li>5.2.2.1.23. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0693.html">SetDim</a></li><li>5.2.2.1.24. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0694.html">SetSingleRange</a></li><li>5.2.2.1.25. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0695.html">GetSingleShape</a></li><li>5.2.2.1.26. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0696.html">GetCoreNum</a></li><li>5.2.2.1.27. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0697.html">SetAlignSplit</a></li><li>5.2.2.1.28. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0698.html">SetDequantType</a></li><li>5.2.2.1.29. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0699.html">SetALayout</a></li><li>5.2.2.1.30. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0700.html">SetBLayout</a></li><li>5.2.2.1.31. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0701.html">SetCLayout</a></li><li>5.2.2.1.32. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0702.html">SetBatchNum</a></li><li>5.2.2.1.33. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0703.html">SetBatchInfoForNormal</a></li><li>5.2.2.1.34. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0704.html">SetMatmulConfigParams</a></li><li>5.2.2.1.35. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0705.html">SetBias</a></li><li>5.2.2.1.36. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0706.html">SetSplitK</a></li><li>5.2.2.1.37. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10111.html">SetSparse</a></li></ul></li><li>5.2.2.2. 获取Matmul计算所需空间
<ul><li>5.2.2.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0708.html">MultiCoreMatmulGetTmpBufSize</a></li><li>5.2.2.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10096.html">MultiCoreMatmulGetTmpBufSizeV2</a></li><li>5.2.2.2.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0709.html">BatchMatmulGetTmpBufSize</a></li><li>5.2.2.2.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10097.html">BatchMatmulGetTmpBufSizeV2</a></li><li>5.2.2.2.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0710.html">MatmulGetTmpBufSize</a></li><li>5.2.2.2.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10098.html">MatmulGetTmpBufSizeV2</a></li></ul></li></ul></li></ul></li><li>5.3. 激活函数
<ul><li>5.3.1. SoftMax
<ul><li>5.3.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0754.html">SoftMax</a></li><li>5.3.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0755.html">SimpleSoftMax</a></li><li>5.3.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0756.html">SoftmaxFlash</a></li><li>5.3.1.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0757.html">SoftmaxGrad</a></li><li>5.3.1.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0758.html">SoftmaxFlashV2</a></li><li>5.3.1.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10001.html">SoftmaxFlashV3</a></li><li>5.3.1.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0759.html">SoftmaxGradFront</a></li><li>5.3.1.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0760.html">AdjustSoftMaxRes</a></li><li>5.3.1.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0761.html">SoftMax Tiling使用说明</a></li><li>5.3.1.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0762.html">SoftMax/SimpleSoftMax Tiling</a></li><li>5.3.1.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0763.html">SoftmaxFlash Tiling接口</a></li><li>5.3.1.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0764.html">SoftmaxGrad Tiling接口</a></li><li>5.3.1.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0765.html">SoftmaxFlashV2 Tiling接口</a></li><li>5.3.1.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10002.html">SoftmaxFlashV3 Tiling接口</a></li><li>5.3.1.15. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0766.html">IsBasicBlockInSoftMax</a></li></ul></li><li>5.3.2. LogSoftMax
<ul><li>5.3.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0768.html">LogSoftMax</a></li><li>5.3.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0769.html">LogSoftMax Tiling</a></li></ul></li><li>5.3.3. Gelu
<ul><li>5.3.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0771.html">Gelu</a></li><li>5.3.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0772.html">FasterGelu</a></li><li>5.3.3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0773.html">FasterGeluV2</a></li><li>5.3.3.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0774.html">GetGeluMaxMinTmpSize</a></li></ul></li><li>5.3.4. SwiGLU
<ul><li>5.3.4.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0776.html">SwiGLU</a></li><li>5.3.4.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0777.html">GetSwiGLUMaxMinTmpSize</a></li><li>5.3.4.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0778.html">GetSwiGLUTmpBufferFactorSize</a></li></ul></li><li>5.3.5. Silu
<ul><li>5.3.5.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0780.html">Silu</a></li><li>5.3.5.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0781.html">GetSiluTmpSize</a></li></ul></li><li>5.3.6. Swish
<ul><li>5.3.6.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0783.html">Swish</a></li><li>5.3.6.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0784.html">GetSwishTmpSize</a></li></ul></li><li>5.3.7. GeGLU
<ul><li>5.3.7.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0786.html">GeGLU</a></li><li>5.3.7.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0787.html">GetGeGLUMaxMinTmpSize</a></li><li>5.3.7.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0788.html">GetGeGLUTmpBufferFactorSize</a></li></ul></li><li>5.3.8. ReGlu
<ul><li>5.3.8.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0790.html">ReGlu</a></li><li>5.3.8.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0791.html">GetReGluMaxMinTmpSize</a></li></ul></li><li>5.3.9. Sigmoid
<ul><li>5.3.9.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0793.html">Sigmoid</a></li><li>5.3.9.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0794.html">GetSigmoidMaxMinTmpSize</a></li></ul></li></ul></li><li>5.4. 数据归一化
<ul><li>5.4.1. LayerNorm
<ul><li>5.4.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0797.html">LayerNorm</a></li><li>5.4.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0798.html">LayerNormGrad</a></li><li>5.4.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0799.html">LayerNormGradBeta</a></li></ul></li><li>5.4.2. LayerNorm Tiling
<ul><li>5.4.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0801.html">LayerNorm Tiling</a></li><li>5.4.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0802.html">LayerNormGrad Tiling</a></li><li>5.4.2.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0803.html">LayerNormGradBeta Tiling</a></li></ul></li><li>5.4.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0804.html">RmsNorm</a></li><li>5.4.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0805.html">RmsNorm Tiling</a></li><li>5.4.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0806.html">BatchNorm</a></li><li>5.4.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0807.html">BatchNorm Tiling</a></li><li>5.4.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0808.html">DeepNorm</a></li><li>5.4.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0809.html">DeepNorm Tiling</a></li><li>5.4.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0810.html">Normalize</a></li><li>5.4.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0811.html">Normalize Tiling</a></li><li>5.4.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0812.html">WelfordUpdate</a></li><li>5.4.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0813.html">WelfordUpdate Tiling</a></li><li>5.4.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0814.html">WelfordFinalize</a></li><li>5.4.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0815.html">WelfordFinalize Tiling</a></li><li>5.4.15. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0816.html">GroupNorm</a></li><li>5.4.16. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10003.html">GroupNorm Tiling</a></li></ul></li><li>5.5. 量化反量化
<ul><li>5.5.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0818.html">AscendQuant</a></li><li>5.5.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0819.html">GetAscendQuantMaxMinTmpSize</a></li><li>5.5.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0820.html">AscendDequant</a></li><li>5.5.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0821.html">GetAscendDequantMaxMinTmpSize</a></li><li>5.5.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0822.html">AscendAntiQuant</a></li><li>5.5.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0823.html">GetAscendAntiQuantMaxMinTmpSize</a></li></ul></li><li>5.6. 归约操作
<ul><li>5.6.1. Sum
<ul><li>5.6.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0826.html">Sum</a></li><li>5.6.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0827.html">GetSumMaxMinTmpSize</a></li></ul></li><li>5.6.2. Mean
<ul><li>5.6.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0829.html">Mean</a></li><li>5.6.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0830.html">GetMeanMaxMinTmpSize</a></li><li>5.6.2.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0831.html">GetMeanTmpBufferFactorSize</a></li></ul></li><li>5.6.3. ReduceXorSum
<ul><li>5.6.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0833.html">ReduceXorSum</a></li><li>5.6.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0834.html">GetReduceXorSumMaxMinTmpSize</a></li></ul></li><li>5.6.4. ReduceSum
<ul><li>5.6.4.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10018.html">ReduceSum</a></li><li>5.6.4.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10160.html">GetReduceSumMaxMinTmpSize</a></li></ul></li><li>5.6.5. ReduceMean
<ul><li>5.6.5.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10157.html">ReduceMean</a></li><li>5.6.5.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10161.html">GetReduceMeanMaxMinTmpSize</a></li></ul></li><li>5.6.6. ReduceMax
<ul><li>5.6.6.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10055.html">ReduceMax</a></li><li>5.6.6.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10147.html">GetReduceMaxMaxMinTmpSize</a></li></ul></li><li>5.6.7. ReduceMin
<ul><li>5.6.7.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10056.html">ReduceMin</a></li><li>5.6.7.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10148.html">GetReduceMinMaxMinTmpSize</a></li></ul></li><li>5.6.8. ReduceAny
<ul><li>5.6.8.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10142.html">ReduceAny</a></li><li>5.6.8.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10143.html">GetReduceAnyMaxMinTmpSize</a></li></ul></li><li>5.6.9. ReduceAll
<ul><li>5.6.9.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10145.html">ReduceAll</a></li><li>5.6.9.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10146.html">GetReduceAllMaxMinTmpSize</a></li></ul></li><li>5.6.10. ReduceProd
<ul><li>5.6.10.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10150.html">ReduceProd</a></li><li>5.6.10.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10151.html">GetReduceProdMaxMinTmpSize</a></li></ul></li></ul></li><li>5.7. 排序
<ul><li>5.7.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0836.html">TopK</a></li><li>5.7.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0837.html">TopK Tiling</a></li><li>5.7.3. Sort
<ul><li>5.7.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0839.html">Concat</a></li><li>5.7.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0840.html">GetConcatTmpSize</a></li><li>5.7.3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0841.html">Extract</a></li><li>5.7.3.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0842.html">Sort</a></li><li>5.7.3.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0843.html">GetSortTmpSize</a></li><li>5.7.3.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0845.html">GetSortOffset</a></li><li>5.7.3.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0846.html">GetSortLen</a></li><li>5.7.3.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0847.html">MrgSort</a></li></ul></li></ul></li><li>5.8. 数据填充
<ul><li>5.8.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0849.html">Pad</a></li><li>5.8.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0850.html">Pad Tiling</a></li><li>5.8.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0851.html">UnPad</a></li><li>5.8.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0852.html">UnPad Tiling</a></li><li>5.8.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0853.html">Broadcast</a></li><li>5.8.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0854.html">GetBroadCastMaxMinTmpSize</a></li></ul></li><li>5.9. 索引操作
<ul><li>5.9.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0856.html">ArithProgression</a></li><li>5.9.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0857.html">GetArithProgressionMaxMinTmpSize</a></li></ul></li><li>5.10. 比较选择
<ul><li>5.10.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0859.html">SelectWithBytesMask</a></li><li>5.10.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0860.html">GetSelectWithBytesMaskMaxMinTmpSize</a></li></ul></li><li>5.11. 数据过滤
<ul><li>5.11.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0862.html">DropOut</a></li><li>5.11.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0863.html">GetDropOutMaxMinTmpSize</a></li></ul></li><li>5.12. 变形
<ul><li>5.12.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0865.html">ConfusionTranspose</a></li><li>5.12.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0866.html">ConfusionTranspose Tiling</a></li><li>5.12.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10181.html">TransData</a></li><li>5.12.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10182.html">GetTransDataMaxMinTmpSize</a></li></ul></li><li>5.13. Hccl
<ul><li>5.13.1. Hccl
<ul><li>5.13.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0869.html">使用说明</a></li><li>5.13.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0870.html">Hccl模板参数</a></li><li>5.13.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0871.html">Init</a></li><li>5.13.1.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10047.html">SetCcTiling</a></li><li>5.13.1.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0872.html">AllReduce</a></li><li>5.13.1.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0873.html">AllGather</a></li><li>5.13.1.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0874.html">ReduceScatter</a></li><li>5.13.1.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0875.html">AlltoAll</a></li><li>5.13.1.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0876.html">AlltoAllV</a></li><li>5.13.1.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10132.html">BatchWrite</a></li><li>5.13.1.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0877.html">Commit</a></li><li>5.13.1.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0878.html">Wait</a></li><li>5.13.1.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10162.html">Iterate</a></li><li>5.13.1.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0879.html">Query</a></li><li>5.13.1.15. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0880.html">InterHcclGroupSync</a></li><li>5.13.1.16. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0881.html">Finalize</a></li><li>5.13.1.17. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0882.html">GetWindowsInAddr</a></li><li>5.13.1.18. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0883.html">GetWindowsOutAddr</a></li><li>5.13.1.19. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0884.html">GetRankId</a></li><li>5.13.1.20. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0885.html">GetRankDim</a></li></ul></li><li>5.13.2. Hccl Tiling
<ul><li>5.13.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0887.html">使用说明</a></li><li>5.13.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10048.html">TilingData结构体</a></li><li>5.13.2.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10036.html">构造函数</a></li><li>5.13.2.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10037.html">GetTiling</a></li><li>5.13.2.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10038.html">SetOpType</a></li><li>5.13.2.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10039.html">SetGroupName</a></li><li>5.13.2.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10040.html">SetAlgConfig</a></li><li>5.13.2.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10041.html">SetReduceType</a></li><li>5.13.2.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10042.html">SetStepSize</a></li><li>5.13.2.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10043.html">SetSkipLocalRankCopy</a></li><li>5.13.2.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10044.html">SetSkipBufferWindowCopy</a></li><li>5.13.2.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10045.html">SetDebugMode</a></li><li>5.13.2.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0888.html">v1版本TilingData（废弃）</a></li><li>5.13.2.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0889.html">v2版本TilingData（废弃）</a></li></ul></li><li>5.13.3. Hccl Context
<ul><li>5.13.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1217.html">简介</a></li><li>5.13.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1218.html">SetHcclContext</a></li><li>5.13.3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1219.html">GetHcclContext</a></li></ul></li></ul></li><li>5.14. 工具类
<ul><li>5.14.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0891.html">InitGlobalMemory</a></li></ul></li><li>5.15. 卷积正向
<ul><li>5.15.1. Conv3D
<ul><li>5.15.1.1. Conv3D
<ul><li>5.15.1.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10070.html">使用说明</a></li><li>5.15.1.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10186.html">Conv3D模板参数</a></li><li>5.15.1.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10071.html">Init</a></li><li>5.15.1.1.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10072.html">SetInput</a></li><li>5.15.1.1.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10073.html">SetWeight</a></li><li>5.15.1.1.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10074.html">SetBias</a></li><li>5.15.1.1.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10075.html">SetSingleOutputShape</a></li><li>5.15.1.1.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10076.html">SetInputStartPosition</a></li><li>5.15.1.1.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10077.html">IterateAll</a></li><li>5.15.1.1.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10078.html">End</a></li></ul></li><li>5.15.1.2. Conv3D Tiling
<ul><li>5.15.1.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10080.html">使用说明</a></li><li>5.15.1.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10081.html">构造函数</a></li><li>5.15.1.2.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10082.html">TConv3DApiTiling结构体</a></li><li>5.15.1.2.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10083.html">GetTiling</a></li><li>5.15.1.2.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10084.html">SetOrgWeightShape</a></li><li>5.15.1.2.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10085.html">SetOrgInputShape</a></li><li>5.15.1.2.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10086.html">SetSingleWeightShape</a></li><li>5.15.1.2.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10087.html">SetSingleOutputShape</a></li><li>5.15.1.2.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10088.html">SetInputType</a></li><li>5.15.1.2.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10089.html">SetWeightType</a></li><li>5.15.1.2.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10090.html">SetBiasType</a></li><li>5.15.1.2.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10091.html">SetOutputType</a></li><li>5.15.1.2.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10092.html">SetPadding</a></li><li>5.15.1.2.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10093.html">SetDilation</a></li><li>5.15.1.2.15. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10094.html">SetStride</a></li><li>5.15.1.2.16. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10095.html">SetGroups</a></li></ul></li></ul></li></ul></li><li>5.16. 卷积反向
<ul><li>5.16.1. Conv3DBackpropInput
<ul><li>5.16.1.1. Conv3DBackpropInput
<ul><li>5.16.1.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0920.html">使用说明</a></li><li>5.16.1.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0921.html">Init</a></li><li>5.16.1.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0922.html">SetGradOutput</a></li><li>5.16.1.1.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0923.html">SetWeight</a></li><li>5.16.1.1.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0924.html">SetSingleShape</a></li><li>5.16.1.1.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10067.html">SetStartPosition</a></li><li>5.16.1.1.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0925.html">Iterate</a></li><li>5.16.1.1.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0927.html">GetTensorC</a></li><li>5.16.1.1.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0928.html">End</a></li></ul></li><li>5.16.1.2. Conv3DBackpropInput Tiling
<ul><li>5.16.1.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0930.html">使用说明</a></li><li>5.16.1.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0931.html">构造函数</a></li><li>5.16.1.2.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0932.html">TConv3DBackpropInputTiling结构体</a></li><li>5.16.1.2.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0933.html">GetTiling</a></li><li>5.16.1.2.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0934.html">SetWeightShape</a></li><li>5.16.1.2.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0935.html">SetInputShape</a></li><li>5.16.1.2.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0936.html">SetGradOutputShape</a></li><li>5.16.1.2.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0937.html">SetWeightType</a></li><li>5.16.1.2.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0938.html">SetInputType</a></li><li>5.16.1.2.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0939.html">SetGradOutputType</a></li><li>5.16.1.2.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0940.html">SetPadding</a></li><li>5.16.1.2.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0941.html">SetStride</a></li><li>5.16.1.2.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0942.html">SetDilation</a></li><li>5.16.1.2.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10192.html">SetOutputPadding</a></li></ul></li></ul></li><li>5.16.2. Conv3DBackpropFilter
<ul><li>5.16.2.1. Conv3DBackpropFilter
<ul><li>5.16.2.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0895.html">使用说明</a></li><li>5.16.2.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0896.html">Init</a></li><li>5.16.2.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0897.html">SetInput</a></li><li>5.16.2.1.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0898.html">SetGradOutput</a></li><li>5.16.2.1.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0899.html">SetSingleShape</a></li><li>5.16.2.1.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10193.html">SetStartPosition</a></li><li>5.16.2.1.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0901.html">Iterate</a></li><li>5.16.2.1.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0902.html">GetTensorC</a></li><li>5.16.2.1.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0903.html">End</a></li></ul></li><li>5.16.2.2. Conv3DBackpropFilter Tiling
<ul><li>5.16.2.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0905.html">使用说明</a></li><li>5.16.2.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0906.html">构造函数</a></li><li>5.16.2.2.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0907.html">TConv3DBpFilterTiling结构体</a></li><li>5.16.2.2.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0908.html">GetTiling</a></li><li>5.16.2.2.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0909.html">SetWeightShape</a></li><li>5.16.2.2.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0910.html">SetInputShape</a></li><li>5.16.2.2.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0911.html">SetGradOutputShape</a></li><li>5.16.2.2.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0912.html">SetWeightType</a></li><li>5.16.2.2.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0913.html">SetInputType</a></li><li>5.16.2.2.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0914.html">SetGradOutputType</a></li><li>5.16.2.2.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0915.html">SetPadding</a></li><li>5.16.2.2.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0916.html">SetStride</a></li><li>5.16.2.2.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0917.html">SetDilation</a></li></ul></li></ul></li></ul></li><li>5.17. 模板库函数
<ul><li>5.17.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10053.html">max</a></li><li>5.17.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10054.html">min</a></li><li>5.17.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10106.html">index_sequence</a></li><li>5.17.4. 容器函数
<ul><li>5.17.4.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10108.html">tuple</a></li><li>5.17.4.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10109.html">get</a></li><li>5.17.4.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10110.html">make_tuple</a></li></ul></li><li>5.17.5. type<em>traits
<ul><li>5.17.5.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10114.html">is_convertible</a></li><li>5.17.5.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10115.html">is<em>base</em>of</a></li><li>5.17.5.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10116.html">is_same</a></li><li>5.17.5.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_10117.html">enable_if</a></li><li>5.17.5.5. [conditional](https://www.hiascend.com/doc</li></ul></em>center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc<em>api</em>07_10118.html)</li></ul></li></ul></li></ol></li><li><ol start="6"><li>Host API
<ul><li>6.1. 原型注册与管理
<ul><li>6.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0945.html">原型注册接口（OP_ADD）</a></li><li>6.1.2. OpDef
<ul><li>6.1.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0947.html">Input</a></li><li>6.1.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0948.html">Output</a></li><li>6.1.2.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0949.html">Attr</a></li><li>6.1.2.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0950.html">SetInferShape</a></li><li>6.1.2.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0951.html">SetInferShapeRange</a></li><li>6.1.2.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0952.html">SetInferDataType</a></li><li>6.1.2.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0953.html">AICore</a></li><li>6.1.2.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0954.html">MC2</a></li><li>6.1.2.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00055.html">EnableFallBack</a></li><li>6.1.2.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0956.html">Comment</a></li><li>6.1.2.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00006.html">FormatMatchMode</a></li></ul></li><li>6.1.3. OpParamDef
<ul><li>6.1.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0958.html">ParamType</a></li><li>6.1.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0959.html">DataType</a></li><li>6.1.3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00000.html">DataTypeForBinQuery</a></li><li>6.1.3.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0960.html">DataTypeList</a></li><li>6.1.3.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0961.html">Format</a></li><li>6.1.3.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00001.html">FormatForBinQuery</a></li><li>6.1.3.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0962.html">FormatList</a></li><li>6.1.3.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0963.html">UnknownShapeFormat（废弃）</a></li><li>6.1.3.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0964.html">ValueDepend</a></li><li>6.1.3.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0965.html">IgnoreContiguous</a></li><li>6.1.3.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0966.html">AutoContiguous</a></li><li>6.1.3.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0967.html">Scalar</a></li><li>6.1.3.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0968.html">ScalarList</a></li><li>6.1.3.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0969.html">To</a></li><li>6.1.3.15. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0970.html">Version</a></li><li>6.1.3.16. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0972.html">InitValue</a></li><li>6.1.3.17. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0973.html">OutputShapeDependOnCompute</a></li><li>6.1.3.18. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0974.html">Follow</a></li><li>6.1.3.19. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0975.html">Comment</a></li></ul></li><li>6.1.4. OpAttrDef
<ul><li>6.1.4.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0976.html">OpAttrDef</a></li><li>6.1.4.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0977.html">Comment</a></li></ul></li><li>6.1.5. OpAICoreDef
<ul><li>6.1.5.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0979.html">SetTiling</a></li><li>6.1.5.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0981.html">SetCheckSupport</a></li><li>6.1.5.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0982.html">SetOpSelectFormat</a></li><li>6.1.5.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0986.html">AddConfig</a></li></ul></li><li>6.1.6. OpAICoreConfig
<ul><li>6.1.6.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0989.html">Input</a></li><li>6.1.6.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0990.html">Output</a></li><li>6.1.6.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0991.html">DynamicCompileStaticFlag</a></li><li>6.1.6.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0992.html">DynamicFormatFlag</a></li><li>6.1.6.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0993.html">DynamicRankSupportFlag</a></li><li>6.1.6.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0994.html">DynamicShapeSupportFlag</a></li><li>6.1.6.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0995.html">NeedCheckSupportFlag</a></li><li>6.1.6.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0996.html">PrecisionReduceFlag</a></li><li>6.1.6.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0997.html">ExtendCfgInfo</a></li></ul></li><li>6.1.7. OpMC2Def
<ul><li>6.1.7.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1000.html">简介</a></li><li>6.1.7.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1001.html">构造函数</a></li><li>6.1.7.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1002.html">HcclGroup</a></li><li>6.1.7.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1003.html">operator=</a></li></ul></li></ul></li><li>6.2. Tiling数据结构注册
<ul><li>6.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1005.html">TilingData结构定义</a></li><li>6.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1006.html">TilingData结构注册</a></li><li>6.2.3. ContextBuilder
<ul><li>6.2.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1008.html">简介</a></li><li>6.2.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1009.html">构造函数</a></li><li>6.2.3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1010.html">KernelRunContextHolder结构定义</a></li><li>6.2.3.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1011.html">Inputs</a></li><li>6.2.3.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1012.html">Outputs</a></li><li>6.2.3.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1013.html">BuildKernelRunContext</a></li><li>6.2.3.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1014.html">NodeIoNum</a></li><li>6.2.3.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1015.html">SetOpNameType</a></li><li>6.2.3.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1016.html">IrInstanceNum</a></li><li>6.2.3.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1017.html">AddInputTd</a></li><li>6.2.3.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1018.html">AddOutputTd</a></li><li>6.2.3.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1019.html">AddAttr</a></li><li>6.2.3.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1020.html">CompileInfo</a></li><li>6.2.3.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1021.html">PlatformInfo</a></li><li>6.2.3.15. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00070.html">AddPlatformInfo</a></li><li>6.2.3.16. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1022.html">TilingData</a></li><li>6.2.3.17. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1023.html">Workspace</a></li><li>6.2.3.18. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1024.html">BuildTilingContext</a></li></ul></li><li>6.2.4. OpTilingRegistry
<ul><li>6.2.4.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00072.html">简介</a></li><li>6.2.4.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00073.html">构造和析构函数</a></li><li>6.2.4.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00074.html">GetTilingFunc</a></li><li>6.2.4.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00075.html">LoadTilingLibrary</a></li></ul></li><li>6.2.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00011.html">模板参数定义</a></li><li>6.2.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlas_ascendc_10_00008.html">GET<em>TPL</em>TILING_KEY</a></li><li>6.2.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00057.html">ASCENDC<em>TPL</em>SEL_PARAM</a></li><li>6.2.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00060.html">DEVICE<em>IMPL</em>OP_OPTILING</a></li></ul></li><li>6.3. 平台信息获取
<ul><li>6.3.1. PlatformAscendC
<ul><li>6.3.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00059.html">简介</a></li><li>6.3.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1027.html">构造及析构函数</a></li><li>6.3.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1028.html">GetCoreNum</a></li><li>6.3.1.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1029.html">GetSocVersion</a></li><li>6.3.1.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1030.html">GetCoreNumAic</a></li><li>6.3.1.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1031.html">GetCoreNumAiv</a></li><li>6.3.1.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1032.html">GetCoreNumVector</a></li><li>6.3.1.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1033.html">CalcTschBlockDim</a></li><li>6.3.1.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1034.html">GetCoreMemSize</a></li><li>6.3.1.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1035.html">GetCoreMemBw</a></li><li>6.3.1.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1036.html">GetLibApiWorkSpaceSize</a></li><li>6.3.1.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1037.html">GetResGroupBarrierWorkSpaceSize</a></li><li>6.3.1.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1038.html">GetResCubeGroupWorkSpaceSize</a></li><li>6.3.1.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00061.html">ReserveLocalMemory</a></li></ul></li><li>6.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1039.html">PlatformAscendCManager</a></li></ul></li><li>6.4. 单算子API执行相关接口
<ul><li>6.4.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1042.html">单算子API执行相关接口列表</a></li><li>6.4.2. 框架能力接口
<ul><li>6.4.2.1. 常用宏和类
<ul><li>6.4.2.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1045.html">ADD<em>TO</em>LAUNCHER<em>LIST</em>AICORE</a></li><li>6.4.2.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1046.html">ADD<em>TO</em>LAUNCHER<em>LIST</em>AICPU</a></li><li>6.4.2.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1047.html">CREATE_EXECUTOR</a></li><li>6.4.2.1.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1048.html">DFX_IN</a></li><li>6.4.2.1.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1049.html">DFX_OUT</a></li><li>6.4.2.1.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1050.html">INFER_SHAPE</a></li><li>6.4.2.1.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1051.html">L0_DFX</a></li><li>6.4.2.1.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1052.html">L2<em>DFX</em>PHASE_1</a></li><li>6.4.2.1.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1053.html">L2<em>DFX</em>PHASE_2</a></li><li>6.4.2.1.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1054.html">OP_ATTR</a></li><li>6.4.2.1.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1055.html">OP<em>ATTR</em>NAMES</a></li><li>6.4.2.1.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1056.html">OP<em>EMPTY</em>ARG</a></li><li>6.4.2.1.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1057.html">OP_INPUT</a></li><li>6.4.2.1.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1058.html">OP_MODE</a></li><li>6.4.2.1.15. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1059.html">OP_OUTPUT</a></li><li>6.4.2.1.16. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1060.html">OP_OUTSHAPE</a></li><li>6.4.2.1.17. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1061.html">OP_OPTION</a></li><li>6.4.2.1.18. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1062.html">OP<em>TYPE</em>REGISTER</a></li><li>6.4.2.1.19. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1063.html">OP_WORKSPACE</a></li><li>6.4.2.1.20. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1064.html">OpImplMode</a></li><li>6.4.2.1.21. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1065.html">OpExecMode</a></li></ul></li><li>6.4.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1066.html">bfloat16</a></li><li>6.4.2.3. common<em>types
<ul><li>6.4.2.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1068.html">GetStorageShape</a></li><li>6.4.2.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1069.html">SetStorageShape</a></li><li>6.4.2.3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1070.html">GetOriginalShape</a></li><li>6.4.2.3.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1071.html">SetOriginalShape</a></li><li>6.4.2.3.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1072.html">GetViewShape</a></li><li>6.4.2.3.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1073.html">SetViewShape</a></li><li>6.4.2.3.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1074.html">GetStorageFormat</a></li><li>6.4.2.3.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1075.html">SetStorageFormat</a></li><li>6.4.2.3.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1076.html">GetOriginalFormat</a></li><li>6.4.2.3.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1077.html">SetOriginalFormat</a></li><li>6.4.2.3.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1078.html">GetViewFormat</a></li><li>6.4.2.3.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1079.html">SetViewFormat</a></li><li>6.4.2.3.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1080.html">GetViewStrides</a></li><li>6.4.2.3.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1081.html">SetViewStrides</a></li><li>6.4.2.3.15. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1082.html">Numel</a></li><li>6.4.2.3.16. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1083.html">GetDataType</a></li><li>6.4.2.3.17. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1084.html">IsEmpty</a></li><li>6.4.2.3.18. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1085.html">SetData</a></li><li>6.4.2.3.19. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1086.html">SetDataType</a></li><li>6.4.2.3.20. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1087.html">SetBoolData</a></li><li>6.4.2.3.21. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1088.html">SetIntData</a></li><li>6.4.2.3.22. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1089.html">SetFloatData</a></li><li>6.4.2.3.23. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1090.html">SetFp16Data</a></li><li>6.4.2.3.24. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1091.html">SetBf16Data</a></li><li>6.4.2.3.25. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1092.html">CheckOverflows</a></li><li>6.4.2.3.26. [预留接口](https://www.hiascend.com/doc</li></ul></em>center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc<em>api</em>07_1093.html)</li><li>6.4.2.4. data<em>type</em>utils
<ul><li>6.4.2.4.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1095.html">IsBasicType</a></li><li>6.4.2.4.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1096.html">IsNumberType</a></li><li>6.4.2.4.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1097.html">IsRealNumberType</a></li><li>6.4.2.4.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1098.html">TypeSize</a></li><li>6.4.2.4.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1099.html">ToOpDataType</a></li><li>6.4.2.4.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1100.html">ToAclDataType</a></li><li>6.4.2.4.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1101.html">预留接口</a></li></ul></li><li>6.4.2.5. format<em>utils
<ul><li>6.4.2.5.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1103.html">IsPrivateFormat</a></li><li>6.4.2.5.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1104.html">GetPrimaryFormat</a></li><li>6.4.2.5.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1105.html">ToOpFormat</a></li><li>6.4.2.5.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1106.html">ToAclFormat</a></li><li>6.4.2.5.5. [预留接口](https://www.hiascend.com/doc</li></ul></em>center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc<em>api</em>07_1107.html)</li><li>6.4.2.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1108.html">fp16_t</a></li><li>6.4.2.7. framework<em>op
<ul><li>6.4.2.7.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1110.html">CopyToNpu</a></li><li>6.4.2.7.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1111.html">CopyToNpuSync</a></li><li>6.4.2.7.3. [CopyNpuToNpu](https://www.hiascend.com/doc</li></ul></em>center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc<em>api</em>07_1112.html)</li><li>6.4.2.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1113.html">object</a></li><li>6.4.2.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1114.html">op<em>arg</em>def</a></li><li>6.4.2.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1115.html">op_cache</a></li><li>6.4.2.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1116.html">op<em>cache</em>container</a></li><li>6.4.2.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1224.html">op_config</a></li><li>6.4.2.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1117.html">op_def</a></li><li>6.4.2.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1118.html">op_dfx</a></li><li>6.4.2.15. op<em>executor
<ul><li>6.4.2.15.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1120.html">AllocTensor</a></li><li>6.4.2.15.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1121.html">AllocHostTensor</a></li><li>6.4.2.15.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1122.html">AllocIntArray</a></li><li>6.4.2.15.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1123.html">AllocFloatArray</a></li><li>6.4.2.15.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1124.html">AllocBoolArray</a></li><li>6.4.2.15.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1125.html">AllocTensorList</a></li><li>6.4.2.15.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1126.html">AllocScalarList</a></li><li>6.4.2.15.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1127.html">AllocScalar</a></li><li>6.4.2.15.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1128.html">ConvertToTensor</a></li><li>6.4.2.15.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1129.html">CommonOpExecutorRun</a></li><li>6.4.2.15.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1130.html">ReleaseTo</a></li><li>6.4.2.15.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1131.html">Getworkspacesize</a></li><li>6.4.2.15.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1132.html">AbandonCache</a></li><li>6.4.2.15.14. [预留接口](https://www.hiascend.com/doc</li></ul></em>center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc<em>api</em>07_1133.html)</li><li>6.4.2.16. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1134.html">op_log</a></li><li>6.4.2.17. platform
<ul><li>6.4.2.17.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1136.html">GetCurrentPlatformInfo</a></li><li>6.4.2.17.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1137.html">GetSocVersion</a></li><li>6.4.2.17.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1138.html">GetSocLongVersion</a></li><li>6.4.2.17.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1139.html">GetBlockSize</a></li><li>6.4.2.17.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1140.html">预留接口</a></li></ul></li><li>6.4.2.18. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1141.html">pool_allocator</a></li><li>6.4.2.19. shape<em>utils
<ul><li>6.4.2.19.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1143.html">ToShape</a></li><li>6.4.2.19.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1144.html">ToShapeVector</a></li><li>6.4.2.19.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1145.html">ToContiguousStrides</a></li><li>6.4.2.19.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1146.html">CheckBroadcastShape</a></li><li>6.4.2.19.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1147.html">BroadcastInferShape</a></li><li>6.4.2.19.6. [预留接口](https://www.hiascend.com/doc</li></ul></em>center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc<em>api</em>07_1148.html)</li><li>6.4.2.20. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1149.html">small_vector</a></li><li>6.4.2.21. tensor<em>view</em>utils
<ul><li>6.4.2.21.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1151.html">IsContiguous</a></li><li>6.4.2.21.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1152.html">预留接口</a></li></ul></li><li>6.4.2.22. op<em>common相关接口
<ul><li>6.4.2.22.1. data</li></ul></em>type<em>utils
<ul><li>6.4.2.22.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1155.html">IsComplexType</a></li><li>6.4.2.22.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1156.html">IsFloatingType</a></li><li>6.4.2.22.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1157.html">IsIntegralType</a></li><li>6.4.2.22.1.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1158.html">IsIntegralType（含bool）</a></li><li>6.4.2.22.1.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1159.html">CanCast</a></li><li>6.4.2.22.1.6. [PromoteType](https://www.hiascend.com/doc</li></ul></em>center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc<em>api</em>07_1160.html)</li><li>6.4.2.23. aicpu相关接口
<ul><li>6.4.2.23.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1162.html">AicpuTask类</a></li><li>6.4.2.23.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1163.html">AicpuTaskSpace类</a></li><li>6.4.2.23.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1164.html">aicpu<em>args</em>handler</a></li><li>6.4.2.23.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1165.html">aicpu<em>ext</em>info_handle</a></li><li>6.4.2.23.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1166.html">aicpu_uitls</a></li><li>6.4.2.23.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1167.html">aicpu_task</a></li></ul></li></ul></li><li>6.4.3. 基础核函数接口
<ul><li>6.4.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1194.html">Cast</a></li><li>6.4.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1195.html">Contiguous</a></li><li>6.4.3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1196.html">ViewCopy</a></li><li>6.4.3.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1197.html">Pad</a></li><li>6.4.3.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1198.html">Reshape</a></li><li>6.4.3.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1199.html">Slice</a></li><li>6.4.3.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1200.html">Transpose</a></li><li>6.4.3.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1201.html">TransData</a></li><li>6.4.3.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1202.html">TransDataSpecial</a></li><li>6.4.3.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1203.html">ReFormat</a></li><li>6.4.3.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1204.html">IsNullptr</a></li></ul></li></ul></li><li>6.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1205.html">内部关联接口</a></li></ul></li></ol></li><li><ol start="7"><li>算子调测API
<ul><li>7.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0192.html">DumpTensor</a></li><li>7.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0193.html">printf</a></li><li>7.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0194.html">assert</a></li><li>7.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0195.html">DumpAccChkPoint</a></li><li>7.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_0196.html">Trap</a></li><li>7.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_00002.html">PrintTimeStamp</a></li><li>7.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1207.html">GmAlloc</a></li><li>7.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1208.html">ICPU<em>RUN</em>KF</a></li><li>7.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1209.html">ICPU<em>SET</em>TILING_KEY</a></li><li>7.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1210.html">GmFree</a></li><li>7.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1211.html">SetKernelMode</a></li><li>7.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1212.html">TRACE_START</a></li><li>7.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1213.html">TRACE_STOP</a></li><li>7.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1214.html">MetricsProfStart</a></li><li>7.15. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1215.html">MetricsProfStop</a></li></ul></li></ol></li><li><ol start="8"><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/API/ascendcopapi/atlasascendc_api_07_1220.html">预留接口</a></li></ol></li></ul><h2 id="ascend-c-">Ascend C 最佳实践</h2><ul><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0001.html">1. 前言</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0002.html">2. 异构计算</a></li><li><ol start="3"><li>功能调试
<ul><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0004.html">3.1. 运行正常</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0005.html">3.2. 精度正常</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0006.html">3.3. 算子调试</a></li></ul></li></ol></li><li><ol start="4"><li>性能分析
<ul><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0008.html">4.1. 获取性能数据</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0009.html">4.2. 分析性能数据</a></li></ul></li></ol></li><li><ol start="5"><li>性能优化
<ul><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_00010.html">5.1. 优化建议总览表</a></li><li>5.2. 搬运优化
<ul><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0013.html">5.2.1. 尽量一次搬运较大的数据块</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0014.html">5.2.2. GM地址尽量512B对齐</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0015.html">5.2.3. 高效的使用搬运API</a></li></ul></li><li>5.3. 内存优化
<ul><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0017.html">5.3.1. 算子与高阶API共享临时Buffer</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0018.html">5.3.2. 限制TilingData结构大小</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0019.html">5.3.3. 通过缩减Tensor ShapeInfo维度，优化栈空间</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0020.html">5.3.4. 通过Unified Buffer融合实现连续vector计算</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0021.html">5.3.5. 通过BT Buffer实现高效的bias计算</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0022.html">5.3.6. 通过FP Buffer存放量化参数实现高效随路量化</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0023.html">5.3.7. 通过L0C Buffer数据暂存实现高效的矩阵乘结果累加</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0024.html">5.3.8. 较小矩阵长驻L1 Buffer，仅分次搬运较大矩阵</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0025.html">5.3.9. 优化bank分配以提升读写性能</a></li></ul></li><li>5.4. API使用优化
<ul><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0027.html">5.4.1. 纯搬运类算子VECIN和VECOUT建议复用</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0028.html">5.4.2. 避免TPipe在对象内创建和初始化</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0029.html">5.4.3. Matmul使能AtomicAdd选项</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0030.html">5.4.4. Vector算子灵活运用Counter模式</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0031.html">5.4.5. 针对不同场景合理使用归约指令</a></li></ul></li><li>5.5. 流水优化
<ul><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0033.html">5.5.1. 使能double buffer</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0034.html">5.5.2. 使能Iterate或IterateAll异步接口避免AIC/AIV同步依赖</a></li></ul></li><li>5.6. Tiling优化
<ul><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0036.html">5.6.1. L2 Cache切分</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0037.html">5.6.2. 核间负载均衡</a></li></ul></li></ul></li></ol></li><li><ol start="6"><li>优秀实践
<ul><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0040.html">6.1. FlashAttention算子性能调优案例</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0041.html">6.2. Matmul算子性能调优案例</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0042.html">6.3. GroupedMatmul算子性能调优案例</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_0043.html">6.4. MC²算子性能调优案例</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_10000.html">6.5. Matmul高阶API使能IBShare性能提升案例</a></li><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/opdevg/ascendcbestP/atlas_ascendc_best_practices_10_10001.html">6.6. Matmul常量化算子性能提升案例</a></li></ul></li></ol></li></ul><h2 id="">算子开发工具</h2><ul><li><ol start="1"><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0002.html">简介</a></li></ol></li><li><ol start="2"><li><a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0003.html">环境准备</a></li></ol></li><li><ol start="3"><li>算子设计（msKPP）
<ul><li>3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0006.html">工具概述</a></li><li>3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0007.html">使用前准备</a></li><li>3.3. 性能建模
<ul><li>3.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0152.html">原理概述</a></li><li>3.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0009.html">算子特性建模</a></li><li>3.3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0010.html">算子计算搬运规格分析</a></li><li>3.3.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0011.html">极限性能分析</a></li><li>3.3.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0012.html">算子tiling初步设计</a></li><li>3.3.6. 对外接口使用说明
<ul><li>3.3.6.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0001.html">接口列表</a></li><li>3.3.6.2. 基础功能接口
<ul><li>3.3.6.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0003.html">Chip</a></li><li>3.3.6.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0004.html">Core</a></li><li>3.3.6.2.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0005.html">Tensor</a></li><li>3.3.6.2.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0006.html">Tensor.load</a></li></ul></li><li>3.3.6.3. 同步类指令接口
<ul><li>3.3.6.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_00073.html">set_flag</a></li><li>3.3.6.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_00074.html">wait_flag</a></li></ul></li><li>3.3.6.4. 指令接口
<ul><li>3.3.6.4.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0007.html">mmad</a></li><li>3.3.6.4.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0008.html">vadd</a></li><li>3.3.6.4.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0009.html">vbrcb</a></li><li>3.3.6.4.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0010.html">vconv</a></li><li>3.3.6.4.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0011.html">vconv_deq</a></li><li>3.3.6.4.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0012.html">vconv_vdeq</a></li><li>3.3.6.4.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0013.html">vector_dup</a></li><li>3.3.6.4.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0014.html">vexp</a></li><li>3.3.6.4.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0015.html">vln</a></li><li>3.3.6.4.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0016.html">vmax</a></li><li>3.3.6.4.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0017.html">vmul</a></li><li>3.3.6.4.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0018.html">vmuls</a></li><li>3.3.6.4.13. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0019.html">vsub</a></li><li>3.3.6.4.14. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0020.html">vdiv</a></li><li>3.3.6.4.15. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0021.html">vcadd</a></li><li>3.3.6.4.16. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0022.html">vabs</a></li><li>3.3.6.4.17. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0023.html">vaddrelu</a></li><li>3.3.6.4.18. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0024.html">vaddreluconv</a></li><li>3.3.6.4.19. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0025.html">vadds</a></li><li>3.3.6.4.20. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0026.html">vand</a></li><li>3.3.6.4.21. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0027.html">vaxpy</a></li><li>3.3.6.4.22. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0028.html">vbitsort</a></li><li>3.3.6.4.23. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0029.html">vcgadd</a></li><li>3.3.6.4.24. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0030.html">vcgmax</a></li><li>3.3.6.4.25. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0031.html">vcgmin</a></li><li>3.3.6.4.26. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0032.html">vcmax</a></li><li>3.3.6.4.27. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0033.html">vcmin</a></li><li>3.3.6.4.28. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0034.html">vcmp_xxx</a></li><li>3.3.6.4.29. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0035.html">vcmpv_xxx</a></li><li>3.3.6.4.30. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0036.html">vcmpvs_xxx</a></li><li>3.3.6.4.31. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0037.html">vcopy</a></li><li>3.3.6.4.32. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0038.html">vcpadd</a></li><li>3.3.6.4.33. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0039.html">vgather</a></li><li>3.3.6.4.34. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0040.html">vgatherb</a></li><li>3.3.6.4.35. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0041.html">vlrelu</a></li><li>3.3.6.4.36. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0042.html">vmadd</a></li><li>3.3.6.4.37. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0043.html">vmaddrelu</a></li><li>3.3.6.4.38. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0044.html">vmaxs</a></li><li>3.3.6.4.39. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0045.html">vmin</a></li><li>3.3.6.4.40. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0046.html">vmins</a></li><li>3.3.6.4.41. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0047.html">vmla</a></li><li>3.3.6.4.42. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0048.html">vmrgsort</a></li><li>3.3.6.4.43. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0049.html">vmulconv</a></li><li>3.3.6.4.44. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0050.html">vnot</a></li><li>3.3.6.4.45. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0051.html">vor</a></li><li>3.3.6.4.46. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0052.html">vrec</a></li><li>3.3.6.4.47. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0053.html">vreduce</a></li><li>3.3.6.4.48. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0054.html">vreducev2</a></li><li>3.3.6.4.49. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0055.html">vrelu</a></li><li>3.3.6.4.50. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0056.html">vrsqrt</a></li><li>3.3.6.4.51. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0057.html">vsel</a></li><li>3.3.6.4.52. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0058.html">vshl</a></li><li>3.3.6.4.53. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0059.html">vshr</a></li><li>3.3.6.4.54. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0060.html">vsqrt</a></li><li>3.3.6.4.55. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0061.html">vsubrelu</a></li><li>3.3.6.4.56. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0062.html">vsubreluconv</a></li><li>3.3.6.4.57. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdevapi_16_0063.html">vtranspose</a></li></ul></li></ul></li></ul></li><li>3.4. 调用msOpGen算子工程
<ul><li>3.4.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0173.html">功能介绍</a></li><li>3.4.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0174.html">调用示例</a></li><li>3.4.3. 接口列表
<ul><li>3.4.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0185.html">mskpp.tiling_func</a></li><li>3.4.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0186.html">mskpp.get<em>kernel</em>from_binary</a></li></ul></li></ul></li><li>3.5. 自动调优
<ul><li>3.5.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0154.html">功能介绍</a></li><li>3.5.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0155.html">快速入门</a></li><li>3.5.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0168.html">自动调优示例</a></li><li>3.5.4. 接口列表
<ul><li>3.5.4.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0163.html">autotune</a></li><li>3.5.4.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0161.html">code_gen</a></li><li>3.5.4.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0162.html">compile</a></li><li>3.5.4.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0171.html">autotune_v2</a></li><li>3.5.4.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0170.html">compile_executable</a></li></ul></li><li>3.5.5. 附录
<ul><li>3.5.5.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0157.html">basic<em>matmul</em>autotune.py</a></li><li>3.5.5.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0164.html">jit_build.sh</a></li><li>3.5.5.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0183.html">basic<em>matmul</em>executable_autotune.py</a></li><li>3.5.5.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0182.html">jit<em>build</em>executable.sh</a></li></ul></li></ul></li><li>3.6. FAQ
<ul><li>3.6.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0166.html">运行Kernel时提示权限错误</a></li></ul></li></ul></li></ol></li><li><ol start="4"><li>算子工程创建（msOpGen）
<ul><li>4.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0018.html">工具概述</a></li><li>4.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0019.html">使用前准备</a></li><li>4.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0021.html">创建算子工程</a></li><li>4.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0023.html">算子开发</a></li><li>4.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0024.html">算子编译部署</a></li><li>4.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0025.html">查看算子仿真流水图</a></li><li>4.7. 典型案例
<ul><li>4.7.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0027.html">Ascend C自定义算子开发实践</a></li></ul></li></ul></li></ol></li><li><ol start="5"><li>算子测试（msOpST）
<ul><li>5.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0029.html">工具概述</a></li><li>5.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0030.html">使用前准备</a></li><li>5.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0032.html">生成测试用例定义文件</a></li><li>5.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0033.html">生成/执行测试用例</a></li><li>5.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0034.html">生成单算子上板测试框架</a></li><li>5.6. 典型案例
<ul><li>5.6.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0036.html">测试用例定义文件</a></li></ul></li></ul></li></ol></li><li><ol start="6"><li>异常检测（msSanitizer）
<ul><li>6.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0039.html">工具概述</a></li><li>6.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0040.html">使用前准备</a></li><li>6.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0042.html">内存检测</a></li><li>6.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0043.html">竞争检测</a></li><li>6.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0128.html">未初始化检测</a></li><li>6.6. 典型案例
<ul><li>6.6.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0045.html">检测内核调用符方式的Ascend C算子</a></li><li>6.6.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0046.html">检测API调用的单算子</a></li><li>6.6.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0136.html">检测PyTorch接口调用的算子</a></li><li>6.6.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0047.html">检测CANN软件栈的内存</a></li></ul></li><li>6.7. FAQ
<ul><li>6.7.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0134.html">msSanitizer工具异常报告中未显示正确的文件名和行号</a></li><li>6.7.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0135.html">msSanitizer工具使用&quot;--cce-enable-sanitizer -g&quot;编译算子时出现&quot;InputSection too large&quot;错误</a></li><li>6.7.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0138.html">msSanitizer工具提示--cache-size异常</a></li></ul></li><li>6.8. 对外接口使用说明
<ul><li>6.8.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0150.html">接口列表</a></li><li>6.8.2. sanitizer接口
<ul><li>6.8.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0050.html">sanitizerRtMalloc</a></li><li>6.8.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0051.html">sanitizerRtMallocCached</a></li><li>6.8.2.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0052.html">sanitizerRtFree</a></li><li>6.8.2.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0053.html">sanitizerRtMemset</a></li><li>6.8.2.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0054.html">sanitizerRtMemsetAsync</a></li><li>6.8.2.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0055.html">sanitizerRtMemcpy</a></li><li>6.8.2.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0056.html">sanitizerRtMemcpyAsync</a></li><li>6.8.2.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0057.html">sanitizerRtMemcpy2d</a></li><li>6.8.2.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0058.html">sanitizerRtMemcpy2dAsync</a></li><li>6.8.2.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0059.html">sanitizerReportMalloc</a></li><li>6.8.2.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0060.html">sanitizerReportFree</a></li></ul></li><li>6.8.3. 扩展接口（mstx）
<ul><li>6.8.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0143.html">mstx接口简介</a></li><li>6.8.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0144.html">mstxDomainCreateA</a></li><li>6.8.3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0145.html">mstxMemHeapRegister</a></li><li>6.8.3.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0147.html">mstxMemRegionsRegister</a></li><li>6.8.3.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0148.html">mstxMemRegionsUnregister</a></li><li>6.8.3.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0146.html">mstxMemHeapUnregister</a></li></ul></li></ul></li></ul></li></ol></li><li><ol start="7"><li>算子调试（msDebug）
<ul><li>7.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0062.html">工具概述</a></li><li>7.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0063.html">使用前准备</a></li><li>7.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0169.html">指定Device ID（通算融合算子场景）</a></li><li>7.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0066.html">断点设置</a></li><li>7.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0067.html">内存与变量打印</a></li><li>7.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0068.html">单步调试</a></li><li>7.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0069.html">中断运行</a></li><li>7.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0070.html">核切换</a></li><li>7.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0071.html">读取寄存器</a></li><li>7.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0072.html">调试信息展示</a></li><li>7.11. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0149.html">解析异常算子dump文件</a></li><li>7.12. 典型案例
<ul><li>7.12.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0074.html">上板调试vector算子</a></li><li>7.12.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0075.html">调用Ascend CL单算子</a></li><li>7.12.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0076.html">调试PyTorch接口调用的算子</a></li><li>7.12.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0184.html">上板调试模板库的算子</a></li></ul></li><li>7.13. FAQ
<ul><li>7.13.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0078.html">msDebug工具使用&quot;-O0 -g&quot;编译算子时，stack frame size超出限制</a></li><li>7.13.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0079.html">msDebug工具打印Tensor变量功能不可用，提示“unavailable”或“memory read failed”</a></li><li>7.13.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0080.html">msDebug工具在容器环境中调试运行失败，提示需安装HDK驱动包</a></li><li>7.13.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0116.html">msDebug工具断点设置在核函数内，命中断点后执行continue命令，算子运行失败</a></li><li>7.13.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0132.html">msDebug工具在docker中执行&quot;run&quot;命令运行程序后，提示“&#x27;A&#x27; packet returned an error: 8”</a></li></ul></li></ul></li></ol></li><li><ol start="8"><li>算子调优（msProf）
<ul><li>8.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0082.html">工具概述</a></li><li>8.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0083.html">使用前准备</a></li><li>8.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_00851.html">工具使用</a></li><li>8.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0086.html">计算内存热力图</a></li><li>8.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0119.html">Roofline瓶颈分析图</a></li><li>8.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0158.html">Cache热力图</a></li><li>8.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0139.html">通算流水图</a></li><li>8.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0087.html">指令流水图</a></li><li>8.9. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0088.html">算子代码热点图</a></li><li>8.10. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0160.html">内存通路吞吐率波形图</a></li><li>8.11. 性能数据文件
<ul><li>8.11.1. msprof op
<ul><li>8.11.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0093.html">ArithmeticUtilization（cube及vector类型指令耗时和占比）</a></li><li>8.11.1.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0094.html">L2Cache（L2 Cache命中率）</a></li><li>8.11.1.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0095.html">Memory（内存读写带宽速率）</a></li><li>8.11.1.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0096.html">MemoryL0（L0读写带宽速率）</a></li><li>8.11.1.5. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0097.html">MemoryUB（UB读写带宽速率）</a></li><li>8.11.1.6. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0098.html">OpBasicInfo（算子基础信息）</a></li><li>8.11.1.7. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0099.html">PipeUtilization（计算单元和搬运单元耗时占比）</a></li><li>8.11.1.8. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0100.html">ResourceConflictRatio（资源冲突占比）</a></li></ul></li><li>8.11.2. msprof op simulator
<ul><li>8.11.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0101.html">代码行耗时数据文件</a></li><li>8.11.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0102.html">代码指令信息文件</a></li></ul></li></ul></li><li>8.12. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0104.html">Json配置文件说明</a></li><li>8.13. 典型案例
<ul><li>8.13.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0090.html">采集Ascend C算子的性能数据</a></li><li>8.13.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0091.html">通过指令流水图优化算子</a></li><li>8.13.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0140.html">采集MC2算子的性能数据</a></li></ul></li><li>8.14. 扩展接口（mstx）
<ul><li>8.14.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0129.html">mstx接口简介</a></li><li>8.14.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0117.html">mstxRangeStartA</a></li><li>8.14.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_16_0118.html">mstxRangeEnd</a></li></ul></li></ul></li></ol></li><li><ol start="9"><li>附录
<ul><li>9.1. TBE&amp;AI CPU算子开发场景
<ul><li>9.1.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_10_0024.html">基于msOpGen工具创建算子工程</a></li><li>9.1.2. 算子编译部署
<ul><li>9.1.2.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_10_0088.html">简介</a></li><li>9.1.2.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_10_0089.html">算子工程编译</a></li><li>9.1.2.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_10_0090.html">算子交付件独立编译</a></li><li>9.1.2.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_10_0091.html">算子包部署</a></li></ul></li><li>9.1.3. 基于msOpST工具进行算子ST测试
<ul><li>9.1.3.1. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_10_0096.html">简介</a></li><li>9.1.3.2. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_10_0097.html">生成测试用例定义文件</a></li><li>9.1.3.3. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_10_0098.html">生成/执行测试用例</a></li><li>9.1.3.4. <a href="https://www.hiascend.com/doc_center/source/zh/CANNCommunityEdition/82RC1/devaids/optool/atlasopdev_10_0099.html">测试用例定义文件配置样例</a></li></ul></li></ul></li></ul></li></ol></li></ul></div><p style="text-align:right"><a href="https://hyli.xyz/posts/docs/ascend-c#comments">看完了？说点什么呢</a></p></div>]]></description><link>https://hyli.xyz/posts/docs/ascend-c</link><guid isPermaLink="true">https://hyli.xyz/posts/docs/ascend-c</guid><dc:creator><![CDATA[行雺]]></dc:creator><pubDate>Thu, 30 Oct 2025 05:33:02 GMT</pubDate></item><item><title><![CDATA[浙江游]]></title><description><![CDATA[<link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251006_063557.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251006_065702.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251005_173215.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251006_071520.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251005_180749.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251004_201329.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251004_185954.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251003_194544.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251004_200217.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251004_190329.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251004_185707.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251004_195545.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251004_185358.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251003_202358.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251003_200854.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251006_064536.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251005_161203.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251005_143701.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251005_143419.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251006_170511.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251006_183119.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251006_182822.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251006_180928.jpg"/><div><blockquote>该渲染由 Shiro API 生成，可能存在排版问题，最佳体验请前往：<a href="https://hyli.xyz/notes/8">https://hyli.xyz/notes/8</a></blockquote><div><p>国庆假期来临，不想出远门，于是决定去浙江玩一趟。最开始只是想去杭州玩两三天，后面临时起意去宁波呆了一天，走时绕道湖州给我的流量卡办了张副卡</p><h2 id="">杭州</h2><p>杭州的景点基本都在西湖边上，另外又去了铜鉴湖花海</p><h3 id="">西湖</h3><p><img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251006_063557.jpg" height="3072" width="2304"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251006_065702.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251005_173215.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251006_071520.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251005_180749.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251004_201329.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251004_185954.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251003_194544.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251004_200217.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251004_190329.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251004_185707.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251004_195545.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251004_185358.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251003_202358.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251003_200854.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251006_064536.jpg"/></p><h3 id="">钱塘江</h3><p><img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251005_161203.jpg"/></p><h3 id="">铜鉴湖</h3><p><img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251005_143701.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251005_143419.jpg"/></p><h2 id="">宁波</h2><h3 id="">东钱湖</h3><p><img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251006_170511.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251006_183119.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251006_182822.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/ZJ/IMG_20251006_180928.jpg"/></p>
<hr/><p>本次游玩的全部照片：<a href="https://gallery.hyli.xyz/?tag_mode=intersection&amp;tags=2025%2CZJ">空濛集</a></p></div><p style="text-align:right"><a href="https://hyli.xyz/notes/8#comments">看完了？说点什么呢</a></p></div>]]></description><link>https://hyli.xyz/notes/8</link><guid isPermaLink="true">https://hyli.xyz/notes/8</guid><dc:creator><![CDATA[行雺]]></dc:creator><pubDate>Wed, 08 Oct 2025 08:24:55 GMT</pubDate></item><item><title><![CDATA[使用 Cloudflare Images 转换 + Workers 实现托管在 CF 的图床无感压缩]]></title><description><![CDATA[<link rel="preload" as="image" href="https://s.hyli.xyz/img/2025/08/31/1756640426.png"/><link rel="preload" as="image" href="https://s.hyli.xyz/img/2025/08/31/1756637263.png"/><link rel="preload" as="image" href="https://s.hyli.xyz/img/2025/08/31/1756638960.png"/><link rel="preload" as="image" href="https://s.hyli.xyz/img/2025/08/31/1756639595.png"/><div><blockquote>该渲染由 Shiro API 生成，可能存在排版问题，最佳体验请前往：<a href="https://hyli.xyz/posts/tutorial/cloudflare-images-workers-image-compression">https://hyli.xyz/posts/tutorial/cloudflare-images-workers-image-compression</a></blockquote><div><p>最近发现了 Cloudflare 有一个 Images 转换服务，可以用来处理图片，搭配 Workers，实现访问图片的 URL 不变，无感压缩图片，很适合图床使用。当然前提是图片托管到 CF，小黄云代理或是 R2 对象存储都可以。免费版每月有 5000 次的转换额度，实际上一张图片转换过一次后就会缓存，下次访问不会再占额度。另外，只对嵌入在网页中的图片有效，不影响单独标签页打开图片。</p><h2 id="">实现效果</h2><p>以<a href="https://hyli.xyz/notes/7">香港-深圳-广州游</a>为例，7-8MB 的 JPG 原图被压缩为了 1-2MB 的 WEBP 图片，大幅缩短了打开网站所需的时间，部分图片压缩时间超过免费版 Workers 限制，保持原图。</p><p><img src="https://s.hyli.xyz/img/2025/08/31/1756640426.png" height="498" width="1846"/></p><h2 id="">配置步骤</h2><p>接下来的教程中提及到的域名如下，请自行替换为你的域名：</p><ul><li><code>example.com</code>：域名</li><li><code>www.example.com</code>：图床域名</li></ul><h3 id="-cloudflare-images-">第一步：启用 Cloudflare Images 转换</h3><p>首先来到 <a href="https://dash.cloudflare.com">Dashboard</a>，找到 Images -&gt; 转换，给 <code>example.com</code> 启用转换。</p><p><img src="https://s.hyli.xyz/img/2025/08/31/1756637263.png"/></p><h3 id="">第二步：配置源服务器</h3><p>然后在源里面添加指定源服务器：<code>www.example.com</code>，保存。</p><p><img src="https://s.hyli.xyz/img/2025/08/31/1756638960.png"/></p><h3 id="-workers">第三步：创建 Workers</h3><p>来到 Workers，创建一个 Worker，填入以下代码：</p><pre class="language-javascript lang-javascript"><code class="language-javascript lang-javascript">export default {
  async fetch(request) {
    if (/image-resizing/.test(request.headers.get(&quot;via&quot;))) {
      return fetch(request)
    }

    let options = { cf: { image: {} } };
    
    const accept = request.headers.get(&quot;Accept&quot;);
    if (/image\/webp/.test(accept)) {
      options.cf.image.format = &quot;webp&quot;;
    } else if (/image\/avif/.test(accept)) {
      options.cf.image.format = &quot;avif&quot;;
    }

    const imageRequest = new Request(request.url, {
      headers: request.headers,
    });

    let transformRequests = fetch(imageRequest, options);

    if ((await transformRequests).status == 200) {
      return transformRequests;
    } else {
      return fetch(request);
    }
  }
};
</code></pre>
<p>这段代码会处理来自用户的请求，然后发起转换请求。免费的 Workers 只有 10ms 的 CPU 时间，所有是有概率转换失败的，这时候会绕过转换直接请求图床。</p><h3 id="-workers-">第四步：配置 Workers 路由</h3><p>最后来到设置配置 Workers 路由，填入 <code>www.example.com/*</code>，这样写的话需要确保该整个 <code>www.example.com</code> 上只有图片，否则对其它类型的文件会访问失败。如果跟我一样图片都在子路径 <code>img</code> 下，就写 <code>www.example.com/img/*</code>。</p><p><img src="https://s.hyli.xyz/img/2025/08/31/1756639595.png"/></p><p>配置好之后按照正常的 URL 访问就可以压缩图片了，压缩失败的会使用原图。</p></div><p style="text-align:right"><a href="https://hyli.xyz/posts/tutorial/cloudflare-images-workers-image-compression#comments">看完了？说点什么呢</a></p></div>]]></description><link>https://hyli.xyz/posts/tutorial/cloudflare-images-workers-image-compression</link><guid isPermaLink="true">https://hyli.xyz/posts/tutorial/cloudflare-images-workers-image-compression</guid><dc:creator><![CDATA[行雺]]></dc:creator><pubDate>Sun, 31 Aug 2025 11:52:48 GMT</pubDate></item><item><title><![CDATA[香港-深圳-广州游]]></title><description><![CDATA[<link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250816_185328.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250817_213931.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250817_204754.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250817_205257.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250817_204609.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250817_205030.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250817_212350.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250817_203637.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250817_203738.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/MVIMG_20250817_173415.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250818_210058.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250818_210617.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250818_210559.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250818_205639.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_153020.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_185204.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_185315.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_220807.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_184458.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_184318.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_203320.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_194558.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_220637.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250820_190016.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250820_185557.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250820_185423.jpg"/><div><blockquote>该渲染由 Shiro API 生成，可能存在排版问题，最佳体验请前往：<a href="https://hyli.xyz/notes/7">https://hyli.xyz/notes/7</a></blockquote><div><p>早已对香港心生向往，恰逢《鬼灭之刃》剧场版在香港上映，便以此为契机，开启了一段说走就走的旅行。除了感受“东方之珠”的魅力，此行还顺便探访了周边的深圳与广州，并成功办理了<a href="#33__%E9%99%84%E5%8A%9E%E7%90%86%E9%A6%99%E6%B8%AF%E9%93%B6%E8%A1%8C%E5%8D%A1">香港银行卡</a>。</p><h2 id="">准备</h2><ul><li><strong>港币</strong>：带了一张中国银行的Mastercard（莫奈卡），并提前存入了一些港币，全程没有携带现金。</li><li><strong>流量</strong>：通过小米手机的“全球上网”应用购买虚拟卡，19.9元/天，含10GB流量。</li><li><strong>住宿</strong>：4晚全部住宿在深圳。</li><li><strong>交通</strong>：在香港使用AlipayHK，深圳和广州则使用支持交通联合的公交卡。</li></ul><h2 id="">花销</h2><p>四天的行程，包含往返交通在内，总花费约2500元人民币。</p><ul><li><strong>香港消费参考</strong>：
大部分商店都支持支付宝和微信，我的中银Mastercard也可以正常消费。
<ul><li><strong>餐饮</strong>：普通正餐平均六七十港币，麦当劳套餐约四五十港币。</li><li><strong>交通</strong>：公共交通单程花费在2-20港币不等。</li><li><strong>娱乐</strong>：观看一场2D电影花费170港币。</li></ul></li></ul><h2 id="">印象</h2><ul><li><strong>香港</strong>：繁华依旧，公共交通极其便利。整体感觉像是空间上更为紧凑的上海。</li><li><strong>深圳</strong>：夜生活丰富，大部分店铺会营业至深夜一两点，非常适合“夜猫子”型游客。</li><li><strong>广州</strong>：游客众多，无论去哪里都感觉人潮拥挤，个人感觉适合游玩的地方不多。</li></ul><hr/><p>接下来是本次旅行的流水账。</p><h2 id="day-0-">Day 0: 出发</h2><h3 id="-">武汉天河机场 ✈️</h3><p>飞机不幸延误了一个小时，抵达深圳福田的旅馆时已是午夜十二点。</p><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250816_185328.jpg" height="3072" width="4096"/></p><h2 id="day-1--">Day 1: 香港 🇭🇰</h2><p>第一天迎接我的是阵雨。中午时分抵达香港，先在九龙站附近的博物馆闲逛一番，下午则到旺角附近，找了家麦当劳蹭网、解决午餐，并着手办理香港银行卡。</p><h3 id="">香港西九龙高铁站</h3><p>从福田站出发，在九龙站过关大约花费了半小时。</p><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250817_213931.jpg"/></p><h3 id="m">M+展亭</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250817_204754.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250817_205257.jpg"/></p><h3 id="">旺角</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250817_204609.jpg"/></p><h3 id="">叮叮车</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250817_205030.jpg"/></p><h3 id="">尖沙咀</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250817_212350.jpg"/></p><h3 id="">香港摩天轮</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250817_203637.jpg"/></p><h3 id="">中环码头</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250817_203738.jpg"/></p><h3 id="">英皇剧院</h3><p>观影需提前在官方App上购票，支付时需要使用外币银行卡，不支持微信和支付宝。</p><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/MVIMG_20250817_173415.jpg"/></p><h2 id="day-2-">Day 2: 深圳</h2><p>下午天气晴好，但晚上却下起了大雨。无奈之下，在旅馆附近找了家网吧打游戏消磨时光。</p><h3 id="">春茧体育场</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250818_210058.jpg"/></p><h3 id="">人才公园</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250818_210617.jpg"/></p><h3 id="">深圳湾公园</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250818_210559.jpg"/></p><h3 id="">万科云城</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250818_205639.jpg"/></p><h2 id="day-3-">Day 3: 香港</h2><p>一觉睡到中午，待雨停后才出门。这次选择从深圳湾口岸过关，效率极高，仅用十分钟便顺利通关。过关后乘坐B2路公交到元朗站，再换乘地铁。</p><h3 id="">元朗</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_153020.jpg"/></p><h3 id="">中环</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_185204.jpg"/></p><h3 id="">中环街市</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_185315.jpg"/></p><h3 id="">坚尼地城</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_220807.jpg"/></p><h3 id="">循道卫理联合教会香港堂</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_184458.jpg"/></p><h3 id="">太古</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_184318.jpg"/></p><h3 id="">礼贤会堂</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_203320.jpg"/></p><h3 id="">太平山顶</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_194558.jpg"/></p><h3 id="">天空走廊</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250819_220637.jpg"/></p><h2 id="day-4-">Day 4: 广州</h2><p>本日天气阵雨。</p><h3 id="">石室圣心大教堂</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250820_190016.jpg"/></p><h3 id="">猎德大桥南</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250820_185557.jpg"/></p><h3 id="">东山湖公园</h3><p><img src="https://s.hyli.xyz/gallery/2025/HK-GD/IMG_20250820_185423.jpg"/></p><hr/><p>本次游玩的全部照片：<a href="https://gallery.hyli.xyz/?tags=HK-GD%2C2025&amp;tag_mode=intersection">空濛集</a></p><h2 id="">附：办理香港银行卡</h2><p>此行成功开立了3家银行的账户，总计将收到5张实体卡。</p><p><strong>开户流程</strong>：
带一部支持NFC的手机，并开通香港漫游。提前下载好 <code>BOCHK</code>、<code>HSBC HK</code>、<code>ZA Bank</code> 三款应用。过关后，通过“12367”小程序下载个人出入境记录。然后，找一个有Wi-Fi的地方（如麦当劳）即可开始在线申请。具体流程可参考网上攻略，按步骤操作即可。</p><ul><li><strong>BOCHK</strong>：申请“自在理财”账户。</li><li><strong>HSBC</strong>：申请“HSBC One”账户。</li><li><strong>ZA Bank</strong>：</li></ul><h3 id="">时间线</h3><h4 id="bochk">BOCHK</h4><ul><li>8.17：申请开立账户</li><li>8.19：审核通过，申请中银卡</li><li>8.21：申请万事达扣账卡</li><li>9.1：收到中银卡、万事达扣账卡</li></ul><h4 id="hsbc">HSBC</h4><ul><li>8.17：申请开立账户，并同时申请万事达扣账卡</li><li>8.19：收到银行“Say hello”欢迎邮件</li><li>8.20：万事达扣账卡寄出</li><li>8.22：收到万事达扣账卡</li><li>8.26：HSBC One 卡寄出</li><li>8.27：收到 One 卡</li><li>10.2：收到密码函</li><li>
<h4 id="za-bank">ZA Bank</h4></li><li>8.17：申请开立账户</li><li>8.18：审核通过，申请实体卡</li><li>8.21：实体卡寄出</li><li>8.23：收到实体卡</li></ul></div><p style="text-align:right"><a href="https://hyli.xyz/notes/7#comments">看完了？说点什么呢</a></p></div>]]></description><link>https://hyli.xyz/notes/7</link><guid isPermaLink="true">https://hyli.xyz/notes/7</guid><dc:creator><![CDATA[行雺]]></dc:creator><pubDate>Thu, 21 Aug 2025 17:16:49 GMT</pubDate></item><item><title><![CDATA[山西游]]></title><description><![CDATA[<link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250723_235610.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250724_001858.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250723_233801.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250724_001302.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250723_234522.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250723_235056.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250901_234751.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250723_234909.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250723_234045.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250724_121125.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250727_193127.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250724_190854.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250725_215152.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250725_211524.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250725_213502.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250725_213434.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250727_193258.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250727_193922.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250728_195007.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250801_222043.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250801_221830.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250801_221439.jpg"/><link rel="preload" as="image" href="https://s.hyli.xyz/gallery/2025/SX/IMG_20250801_213126.jpg"/><div><blockquote>该渲染由 Shiro API 生成，可能存在排版问题，最佳体验请前往：<a href="https://hyli.xyz/notes/9">https://hyli.xyz/notes/9</a></blockquote><div><p>七月下，与高中同学一同前往山西旅行，抛去来回路上2天，总共游玩了10天</p><h2 id="">大同</h2><h3 id="">云冈石窟</h3><p><img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250723_235610.jpg" height="3664" width="2746"/>
<img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250724_001858.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250723_233801.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250724_001302.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250723_234522.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250723_235056.jpg"/></p>
<h3 id="">大同古城</h3><p><img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250901_234751.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250723_234909.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250723_234045.jpg"/></p><h3 id="">应县木塔</h3><p><img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250724_121125.jpg"/></p><h2 id="">悬空寺</h2><p><img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250727_193127.jpg"/></p><h3 id="">恒山</h3><p><img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250724_190854.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250725_215152.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250725_211524.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250725_213502.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250725_213434.jpg"/></p><h2 id="">汾阳</h2><p><img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250727_193258.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250727_193922.jpg"/></p><h2 id="">平遥</h2><p><img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250728_195007.jpg"/></p><h2 id="">太原</h2><p><img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250801_222043.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250801_221830.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250801_221439.jpg"/>
<img src="https://s.hyli.xyz/gallery/2025/SX/IMG_20250801_213126.jpg"/></p>
<hr/><p>本次游玩的全部照片：<a href="https://gallery.hyli.xyz/?tags=SX%2C2025&amp;tag_mode=intersection">空濛集</a></p></div><p style="text-align:right"><a href="https://hyli.xyz/notes/9#comments">看完了？说点什么呢</a></p></div>]]></description><link>https://hyli.xyz/notes/9</link><guid isPermaLink="true">https://hyli.xyz/notes/9</guid><dc:creator><![CDATA[行雺]]></dc:creator><pubDate>Sat, 02 Aug 2025 08:39:54 GMT</pubDate></item></channel></rss>