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

Method forward

python/singa/autograd.py:3424–3442  ·  view source on GitHub ↗

Args: *x (a list of CTensor): List of tensors for max. Returns: CTensor, the output

(self, *x)

Source from the content-addressed store, hash-verified

3422 return res, (mask0, mask1)
3423
3424 def forward(self, *x):
3425 """
3426 Args:
3427 *x (a list of CTensor): List of tensors for max.
3428 Returns:
3429 CTensor, the output
3430 """
3431 assert (len(x) > 0)
3432 self.l = len(x)
3433 if len(x) == 1:
3434 res, masks = self._max(x[0], x[0])
3435 self.masks.append(masks)
3436 return x[0]
3437 res, masks = self._max(x[0], x[1])
3438 self.masks.append(masks)
3439 for i in range(2, len(x)):
3440 res, masks = self._max(res, x[i])
3441 self.masks.append(masks)
3442 return res
3443
3444 def backward(self, dy):
3445 """

Callers

nothing calls this directly

Calls 2

_maxMethod · 0.95
appendMethod · 0.80

Tested by

no test coverage detected