aclnnLogSoftmaxBackward
支持的产品型号
- Atlas 推理系列产品。
- Atlas 训练系列产品。
- Atlas A2训练系列产品。
接口原型
每个算子分为,必须先调用“aclnnLogSoftmaxBackwardGetWorkspaceSize”接口获取计算所需workspace大小以及包含了算子计算流程的执行器,再调用“aclnnLogSoftmaxBackward”接口执行计算。
aclnnStatus aclnnLogSoftmaxBackwardGetWorkspaceSize(const aclTensor *grad_output, const aclTensor *output, int64_t dim, aclTensor* out, uint64_t *workspaceSize, aclOpExecutor **executor)
aclnnStatus aclnnLogSoftmaxBackward(void *workspace, uint64_t workspaceSize, aclOpExecutor *executor,aclrtStream stream)
功能描述
算子功能: logsoftmax的反向传播。
aclnnLogSoftmaxBackwardGetWorkspaceSize
参数说明:
grad_output(const aclTensor *):反向传播的梯度值,即上一层的输出梯度,数据类型支持FLOAT16、FLOAT32、BFLOAT16(仅Atlas A2训练系列产品支持)。支持,支持ND。
output(const aclTensor *): aclnnLogSoftmax函数的输出值,数据类型支持FLOAT16、FLOAT32、BFLOAT16(仅Atlas A2训练系列产品支持)。支持,支持ND。
dim(int64_t *): 反向传播函数的维度,数据类型支持INT64。
out(aclTensor *): 函数的输出是输入的梯度值,即对输入进行求导后的结果,数据类型支持FLOAT16、FLOAT32、BFLOAT16(仅Atlas A2训练系列产品支持)。支持,支持ND,且数据类型、shape需要与grad_output, output一致。
workspaceSize(uint64_t *):返回用户需要在Device侧申请的workspace大小。
executor(aclOpExecutor **):返回op执行器,包含了算子计算流程。
返回值:
aclnnLogSoftmaxBackward
参数说明:
workspace(void *):在Device侧申请的workspace内存地址。
workspaceSize(uint64_t):在Device侧申请的workspace大小,由第一段接口aclnnLogSoftmaxBackwardGetWorkspaceSize获取。
executor(aclOpExecutor *):op执行器,包含了算子计算流程。
stream(const aclrtStream):指定执行任务的 AscendCL Stream流。
返回值:
约束与限制
无。