Skip to content

Commit 75426e0

Browse files
committed
Refine GRU Operator
1 parent 2bed961 commit 75426e0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

paddle/operators/gru_op.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ class GRUGradKernel : public framework::OpKernel<T> {
154154
}
155155
if (h0_grad) {
156156
ordered_h0_grad.mutable_data<T>(h0_grad->dims(), context.GetPlace());
157+
zero(context.device_context(), &ordered_h0_grad, static_cast<T>(0.0));
157158
}
158159

159160
bool is_reverse = context.Attr<bool>("is_reverse");

python/paddle/v2/framework/tests/test_gru_op.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def set_confs(self):
149149
self.is_reverse = True
150150
self.attrs = {
151151
'activation': 'tanh',
152-
'gate_activation': 'tanh',
152+
'gate_activation': 'sigmoid',
153153
'is_reverse': self.is_reverse
154154
}
155155

0 commit comments

Comments
 (0)