Power Tiling

功能说明

Host侧接口,Power接口通用tiling函数,用于获取Power接口能完成计算所需最小的临时空间大小,此空间为预留空间,即需要保证预留有足够的物理空间,用于执行计算。

内部根据srcShape1、srcShape2判断输入类型,判断接口为Power(dstTensor, srcTensor1, srcTensor2)、Power(dstTensor, srcTensor1, scalarValue) 或 Power(dstTensor, scalarValue, srcTensor2),进而返回对应临时空间大小。

函数原型

inline uint32_t GetPowerMinTmpSize(const ge::Shape srcShape1, const ge::Shape srcShape2, const uint32_t typeSize, const bool isReuseSource)

参数说明

表1 接口参数列表

接口

输入/输出

功能

srcShape1

输入

输入1的shape信息。

srcShape2

输入

输入2的shape信息。

typeSize

输入

计算数据类型的单位字节数,比如half类型为2,float类型为4。

isReuseSource

输入

是否允许修改源操作数。

返回值

返回Power接口能完成计算所需最小临时空间大小。

支持的型号

Atlas A2训练系列产品

调用示例

完整的调用样例请参考更多样例