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

Method forward

python/singa/autograd.py:2744–2758  ·  view source on GitHub ↗

Args: x (CTensor): Input tensor Returns: CTensor, the output

(self, x)

Source from the content-addressed store, hash-verified

2742 self.a = a
2743
2744 def forward(self, x):
2745 """
2746 Args:
2747 x (CTensor): Input tensor
2748 Returns:
2749 CTensor, the output
2750 """
2751 if training:
2752 self.input = x
2753 x1 = singa.LTFloat(x, 0.0)
2754 x1 = singa.__mul__(x, x1)
2755 x1 = singa.MultFloat(x1, self.a)
2756 x2 = singa.ReLU(x)
2757 x1 = singa.__add__(x1, x2)
2758 return x1
2759
2760 def backward(self, dy):
2761 """

Callers

nothing calls this directly

Calls 2

__mul__Method · 0.45
__add__Method · 0.45

Tested by

no test coverage detected