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

Method test_random

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

Source from the content-addressed store, hash-verified

134 self.assertAlmostEqual(tensor.to_numpy(a)[0, 0], math.log(12.34))
135
136 def test_random(self):
137 x = tensor.Tensor((1000,))
138 x.gaussian(1, 0.01)
139 self.assertAlmostEqual(tensor.average(x), 1, 3)
140
141 def test_radd(self):
142 x = tensor.Tensor((3,))

Callers

nothing calls this directly

Calls 2

gaussianMethod · 0.95
TensorMethod · 0.80

Tested by

no test coverage detected