modified MaximumGrad

This commit is contained in:
zhengqihao 2021-03-19 15:00:12 +08:00
parent e2ad028194
commit f3a1a69ce5
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ void MaximumGradRecTask(T *x, T *y, T *dout, T *dx, T *dy, size_t dim, size_t x_
size_t dout_i = i * dout_cargo[dim];
if (dim == dout_shape.size() - 1) {
if (*(x + x_index + x_i) >= *(y + y_index + y_i)) {
if (*(x + x_index + x_i) > *(y + y_index + y_i)) {
*(dx + x_index + x_i) += *(dout + dout_index + i);
} else {
*(dy + y_index + y_i) += *(dout + dout_index + i);