Args: a (CTensor): First operand b (CTensor): Second operand Returns: CTensor, the output tuple of CTensor, mask tensor
(self, a, b)
| 3407 | self.masks = [] |
| 3408 | |
| 3409 | def _max(self, a, b): |
| 3410 | """ |
| 3411 | Args: |
| 3412 | a (CTensor): First operand |
| 3413 | b (CTensor): Second operand |
| 3414 | Returns: |
| 3415 | CTensor, the output |
| 3416 | tuple of CTensor, mask tensor |
| 3417 | """ |
| 3418 | m = singa.__sub__(a, b) |
| 3419 | mask0 = singa.GEFloat(m, 0) |
| 3420 | mask1 = singa.LTFloat(m, 0) |
| 3421 | res = singa.__add__(singa.__mul__(mask0, a), singa.__mul__(mask1, b)) |
| 3422 | return res, (mask0, mask1) |
| 3423 | |
| 3424 | def forward(self, *x): |
| 3425 | """ |