提交 7c30251d 编写于 作者: W wanghaoshuang

Fix padding attribute error.

上级 9f8e4981
...@@ -83,8 +83,8 @@ void PadGradFunction(const framework::ExecutionContext& context) { ...@@ -83,8 +83,8 @@ void PadGradFunction(const framework::ExecutionContext& context) {
context.op().GetAttr<std::vector<std::pair<int, int>>>("paddings"); context.op().GetAttr<std::vector<std::pair<int, int>>>("paddings");
Eigen::array<std::pair<int, int>, D> paddings; Eigen::array<std::pair<int, int>, D> paddings;
for (int i = 0; i < pads.size(); ++i) { for (int i = 0; i < pads.size(); ++i) {
paddings[0].first = -paddings[0].first; paddings[i].first = -pads[i].first;
paddings[1].second = -paddings[1].second; paddings[i].second = -pads[i].second;
} }
auto* dOut = context.Input<Tensor>(framework::GradVarName("Out")); auto* dOut = context.Input<Tensor>(framework::GradVarName("Out"));
auto* dX = context.Output<Tensor>(framework::GradVarName("X")); auto* dX = context.Output<Tensor>(framework::GradVarName("X"));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册