MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / test_cosh

Function test_cosh

imperative/python/test/unit/functional/test_elemwise.py:135–140  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

133
134
135def test_cosh():
136 np.random.seed(42)
137 x = np.random.randn(100).astype("float32")
138 y_np = np.cosh(x)
139 y_mge = F.cosh(tensor(x)).numpy()
140 np.testing.assert_allclose(y_np, y_mge, rtol=1e-5)
141
142
143def test_sinh():

Callers

nothing calls this directly

Calls 4

seedMethod · 0.45
astypeMethod · 0.45
coshMethod · 0.45
numpyMethod · 0.45

Tested by

no test coverage detected