文档
注册

SetFixPipeConfig

功能说明

在DataCopy(CO1->GM,参考功能说明)的流程中,会涉及到relu 和quant的流程,分别用于relu和quant计算。通过该接口设置relu和quant的源操作数。

函数原型

template <typename T>

__aicore__ inline void SetFixPipeConfig(const LocalTensor<T> &reluPre, const LocalTensor<T> &quantPre, bool isUnitFlag = false);

template <typename T, bool setRelu = false>

__aicore__ inline void SetFixPipeConfig(const LocalTensor<T> &preTensor, bool isUnitFlag = false);

参数说明

表1 参数说明

参数名称

输入/输出

含义

reluPre

输入

源操作数,relu tensor,类型为LocalTensor,支持的TPosition为CO1。

quantPre

输入

源操作数,quant tensor,类型为LocalTensor,支持的TPosition为CO1。

isUnitFlag

输入

UnitFlag配置项,类型为bool。预留参数,暂未启用,为后续的功能扩展做保留,保持默认值false即可。

setRelu

输入

模板参数,针对设置一个Tensor的情况,当setRelu为True时,设置reluPreTensor;反之设置quantPreTensor。

preTensor

输入

支持设置一个Tensor,通过开关控制是relu Tensor 还是quantTensor

注意事项

接口可以传入两个PreTensor(reluPre, quantPre),也可以传入其中一个Tensor。

支持的型号

Atlas A2训练系列产品/Atlas 800I A2推理产品

返回值

调用示例

__aicore__inline void SetFPC(const LocalTensor <int32_t>& reluPreTensor, const LocalTensor <int32_t>& quantPreTensor)
{
    SetFixPipeConfig<int32_t, true>(reluPreTensor);
    SetFixPipeConfig<int32_t>(reluPreTensor, quantPreTensor);
}
搜索结果
找到“0”个结果

当前产品无相关内容

未找到相关内容,请尝试其他搜索词