MCPcopy Create free account
hub / github.com/apache/singa / _min

Method _min

python/singa/autograd.py:3062–3075  ·  view source on GitHub ↗

Args: a (CTensor): First operand b (CTensor): Second operand Returns: CTensor, the output tuple of CTensor, mask tensor

(self, a, b)

Source from the content-addressed store, hash-verified

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 """

Callers 1

forwardMethod · 0.95

Calls 3

__sub__Method · 0.45
__add__Method · 0.45
__mul__Method · 0.45

Tested by

no test coverage detected