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

Function tanh

dlib/cuda/cudnn_dlibapi.cpp:1974–1993  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1972 // ------------------------------------------------------------------------------------
1973
1974 void tanh (
1975 tensor& dest,
1976 const tensor& src
1977 )
1978 {
1979 DLIB_CASSERT(have_same_dimensions(dest,src));
1980 if (src.size() == 0)
1981 return;
1982
1983 const float alpha = 1;
1984 const float beta = 0;
1985 CHECK_CUDNN(cudnnActivationForward(context(),
1986 tanh_activation_descriptor(),
1987 &alpha,
1988 descriptor(src),
1989 src.device(),
1990 &beta,
1991 descriptor(dest),
1992 dest.device()));
1993 }
1994
1995 void tanh_gradient (
1996 tensor& grad,

Callers

nothing calls this directly

Calls 6

descriptorFunction · 0.85
have_same_dimensionsFunction · 0.70
contextFunction · 0.70
sizeMethod · 0.45
deviceMethod · 0.45

Tested by

no test coverage detected