Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
135
def
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
143
def
test_sinh():
Callers
nothing calls this directly
Calls
4
seed
Method · 0.45
astype
Method · 0.45
cosh
Method · 0.45
numpy
Method · 0.45
Tested by
no test coverage detected