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

Function relu

dlib/cuda/cudnn_dlibapi.cpp:1923–1942  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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,

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