MCPcopy Create free account
hub / github.com/davisking/dlib / tanh

Function tanh

dlib/cuda/cpu_dlib.cpp:2045–2054  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2043 // ------------------------------------------------------------------------------------
2044
2045 void tanh (
2046 tensor& dest,
2047 const tensor& src
2048 )
2049 {
2050 const auto d = dest.host();
2051 const auto s = src.host();
2052 for (size_t i = 0; i < src.size(); ++i)
2053 d[i] = std::tanh(s[i]);
2054 }
2055
2056 void tanh_gradient (
2057 tensor& grad,

Callers 4

test_tanhFunction · 0.50
operator()Method · 0.50
operator()Method · 0.50
forward_inplaceMethod · 0.50

Calls 2

hostMethod · 0.45
sizeMethod · 0.45

Tested by 1

test_tanhFunction · 0.40