fix cdist grad kernel bug

This commit is contained in:
zhangxuetong 2022-12-19 09:16:04 +08:00
parent ab0ef9e32b
commit fae66f87bf
1 changed files with 1 additions and 1 deletions

View File

@ -138,7 +138,7 @@ bool CdistGradCpuKernelMod::Launch(const std::vector<AddressPtr> &inputs, const
float *t1_start = reinterpret_cast<float *>(inputs[1]->addr);
float *t2_start = reinterpret_cast<float *>(inputs[2]->addr);
float *res_start = reinterpret_cast<float *>(outputs[0]->addr);
auto ret = memset_s(res_start, outputs[0]->size, 0, batch_ * r0_ * r1_ * sizeof(float));
auto ret = memset_s(res_start, outputs[0]->size, 0, outputs[0]->size);
if (ret != EOK) {
MS_LOG(EXCEPTION) << "For '" << kernel_name_ << "', memset_s failed, ret=" << ret;
}