| 1921 | // ------------------------------------------------------------------------------------ |
| 1922 | |
| 1923 | void relu ( |
| 1924 | tensor& dest, |
| 1925 | const tensor& src |
| 1926 | ) |
| 1927 | { |
| 1928 | DLIB_CASSERT(have_same_dimensions(dest,src)); |
| 1929 | if (src.size() == 0) |
| 1930 | return; |
| 1931 | |
| 1932 | const float alpha = 1; |
| 1933 | const float beta = 0; |
| 1934 | CHECK_CUDNN(cudnnActivationForward(context(), |
| 1935 | relu_activation_descriptor(), |
| 1936 | &alpha, |
| 1937 | descriptor(src), |
| 1938 | src.device(), |
| 1939 | &beta, |
| 1940 | descriptor(dest), |
| 1941 | dest.device())); |
| 1942 | } |
| 1943 | |
| 1944 | void relu_gradient ( |
| 1945 | tensor& grad, |
nothing calls this directly
no test coverage detected