| 303 | } |
| 304 | |
| 305 | void assign_conv_bias_gradient ( |
| 306 | tensor& grad, |
| 307 | const tensor& gradient_input |
| 308 | ) |
| 309 | { |
| 310 | DLIB_CASSERT( |
| 311 | grad.num_samples() == 1 && |
| 312 | grad.k() >= 1 && |
| 313 | grad.nr() == 1 && |
| 314 | grad.nc() == 1 && |
| 315 | gradient_input.k() == grad.k() && |
| 316 | gradient_input.size() > 0 && |
| 317 | is_same_object(grad,gradient_input) == false |
| 318 | ); |
| 319 | |
| 320 | const float alpha = 1; |
| 321 | const float beta = 0; |
| 322 | CHECK_CUDNN(cudnnConvolutionBackwardBias(context(), |
| 323 | &alpha, |
| 324 | descriptor(gradient_input), |
| 325 | gradient_input.device(), |
| 326 | &beta, |
| 327 | descriptor(grad), |
| 328 | grad.device())); |
| 329 | } |
| 330 | |
| 331 | // ------------------------------------------------------------------------------------ |
| 332 |
nothing calls this directly
no test coverage detected