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

Method test_radd

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

Source from the content-addressed store, hash-verified

139 self.assertAlmostEqual(tensor.average(x), 1, 3)
140
141 def test_radd(self):
142 x = tensor.Tensor((3,))
143 x.set_value(1)
144 y = 1 + x
145 self.assertEqual(tensor.average(y), 2.)
146
147 def test_rsub(self):
148 x = tensor.Tensor((3,))

Callers

nothing calls this directly

Calls 2

set_valueMethod · 0.95
TensorMethod · 0.80

Tested by

no test coverage detected