| 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, |
nothing calls this directly
no test coverage detected