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

Function _np_bn_testing

test/python/test_api.py:57–63  ·  view source on GitHub ↗
(x, scale, bias, rm, rv, momentum=0.1, e=1e-5)

Source from the content-addressed store, hash-verified

55
56
57def _np_bn_testing(x, scale, bias, rm, rv, momentum=0.1, e=1e-5):
58 channel = x.shape[1]
59 np.testing.assert_array_almost_equal(scale.shape, (1, channel, 1, 1))
60 np.testing.assert_array_almost_equal(bias.shape, (1, channel, 1, 1))
61 np.testing.assert_array_almost_equal(rm.shape, (1, channel, 1, 1))
62 np.testing.assert_array_almost_equal(rv.shape, (1, channel, 1, 1))
63 return scale * (x - rm) / np.sqrt(rv + e) + bias
64
65
66def _cTensor_to_pyTensor(cTensor):

Callers 1

_run_testingMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected