Element-wise round the input, In case of halfs, round to the nearest even integer
| 5618 | |
| 5619 | |
| 5620 | class Rounde(Operator): |
| 5621 | """ |
| 5622 | Element-wise round the input, In case of halfs, round to the nearest even integer |
| 5623 | """ |
| 5624 | |
| 5625 | def __init__(self): |
| 5626 | super(Rounde, self).__init__() |
| 5627 | |
| 5628 | def forward(self, x): |
| 5629 | return singa.RoundE(x) |
| 5630 | |
| 5631 | def backward(self, dy): |
| 5632 | dy = singa.Tensor(dy.shape(), dy.device()) |
| 5633 | dy.SetFloatValue(0.) |
| 5634 | return dy |
| 5635 | |
| 5636 | |
| 5637 | def rounde(x): |