Args: a (CTensor): First operand b (CTensor): Second operand Returns: CTensor, the output tuple of CTensor, mask tensor
(self, a, b)
| 3060 | self.masks = [] |
| 3061 | |
| 3062 | def _min(self, a, b): |
| 3063 | """ |
| 3064 | Args: |
| 3065 | a (CTensor): First operand |
| 3066 | b (CTensor): Second operand |
| 3067 | Returns: |
| 3068 | CTensor, the output |
| 3069 | tuple of CTensor, mask tensor |
| 3070 | """ |
| 3071 | m = singa.__sub__(a, b) |
| 3072 | mask0 = singa.LEFloat(m, 0) |
| 3073 | mask1 = singa.GTFloat(m, 0) |
| 3074 | res = singa.__add__(singa.__mul__(mask0, a), singa.__mul__(mask1, b)) |
| 3075 | return res, (mask0, mask1) |
| 3076 | |
| 3077 | def forward(self, *x): |
| 3078 | """ |