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

Method forward

python/singa/autograd.py:3590–3598  ·  view source on GitHub ↗

Return `np.logical_xor(a,b)`, where a and b are CTensor.

(self, a, b)

Source from the content-addressed store, hash-verified

3588 super(Xor, self).__init__()
3589
3590 def forward(self, a, b):
3591 """
3592 Return `np.logical_xor(a,b)`, where a and b are CTensor.
3593 """
3594 m = singa.__sub__(singa.PowFloat(singa.Sign(a), 2.0),
3595 singa.PowFloat(singa.Sign(b), 2.0))
3596 cur = singa.PowFloat(singa.Sign(m), 2.0)
3597
3598 return cur
3599
3600 def backward(self, dy):
3601 """

Callers

nothing calls this directly

Calls 1

__sub__Method · 0.45

Tested by

no test coverage detected