Element-wise round the input
| 5590 | |
| 5591 | |
| 5592 | class Round(Operator): |
| 5593 | """ |
| 5594 | Element-wise round the input |
| 5595 | """ |
| 5596 | |
| 5597 | def __init__(self): |
| 5598 | super(Round, self).__init__() |
| 5599 | |
| 5600 | def forward(self, x): |
| 5601 | return singa.Round(x) |
| 5602 | |
| 5603 | def backward(self, dy): |
| 5604 | dy = singa.Tensor(dy.shape(), dy.device()) |
| 5605 | dy.SetFloatValue(0.) |
| 5606 | return dy |
| 5607 | |
| 5608 | |
| 5609 | def round(x): |