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

Method test_rsub

test/python/test_tensor.py:147–151  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

145 self.assertEqual(tensor.average(y), 2.)
146
147 def test_rsub(self):
148 x = tensor.Tensor((3,))
149 x.set_value(1)
150 y = 1 - x
151 self.assertEqual(tensor.average(y), 0.)
152
153 def test_rmul(self):
154 x = tensor.Tensor((3,))

Callers

nothing calls this directly

Calls 2

set_valueMethod · 0.95
TensorMethod · 0.80

Tested by

no test coverage detected