MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _runner

Method _runner

tensorflow/python/ops/init_ops_test.py:38–55  ·  view source on GitHub ↗
(self,
              init,
              shape,
              target_mean=None,
              target_std=None,
              target_max=None,
              target_min=None)

Source from the content-addressed store, hash-verified

36class InitializersTest(test.TestCase):
37
38 def _runner(self,
39 init,
40 shape,
41 target_mean=None,
42 target_std=None,
43 target_max=None,
44 target_min=None):
45 output = self.evaluate(init(shape))
46 self.assertEqual(output.shape, shape)
47 lim = 3e-2
48 if target_std is not None:
49 self.assertGreater(lim, abs(output.std() - target_std))
50 if target_mean is not None:
51 self.assertGreater(lim, abs(output.mean() - target_mean))
52 if target_max is not None:
53 self.assertGreater(lim, abs(output.max() - target_max))
54 if target_min is not None:
55 self.assertGreater(lim, abs(output.min() - target_min))
56
57 def test_uniform(self):
58 shape = (9, 6, 99)

Callers 14

test_uniformMethod · 0.95
test_normalMethod · 0.95
test_truncated_normalMethod · 0.95
test_constantMethod · 0.95
test_lecun_uniformMethod · 0.95
test_he_uniformMethod · 0.95
test_lecun_normalMethod · 0.95
test_he_normalMethod · 0.95
test_OrthogonalMethod · 0.95
test_IdentityMethod · 0.95

Calls 6

absFunction · 0.70
initFunction · 0.50
evaluateMethod · 0.45
meanMethod · 0.45
maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected