!45583 Fix Bprop BiasAddGrad

Merge pull request !45583 from jiaoy1224/expand
This commit is contained in:
i-robot 2022-11-17 02:13:07 +00:00 committed by Gitee
commit b51cb62474
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 6 additions and 1 deletions

View File

@ -82,7 +82,12 @@ REG_BPROP_BUILDER(kBiasAddOpName).SetBody([](const BpropIRBuilder *ib) -> NodePt
auto w = ib->GetInput(kIndex1);
auto out = ib->GetInput(kIndex2);
auto dout = ib->GetInput(kIndex3);
return {dout, ib->Emit(kBiasAddGradOpName, {dout}, {{"format", ib->GetAttr("data_format")}})};
auto format = GetValue<std::string>(ib->GetAttr("data_format"));
if (format == "NCDHW") {
format = "NCHW";
}
return {dout,
ib->Emit(kBiasAddGradOpName, {dout}, {{"format", MakeValue(format)}, {"data_format", MakeValue(format)}})};
});
REG_BPROP_BUILDER(kReLUOpName).SetBody([](const BpropIRBuilder *ib) -> NodePtrList {