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

Method get_gradient

dlib/cuda/cudnn_dlibapi.cpp:1673–1697  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1671 }
1672
1673 void pooling::get_gradient(
1674 const tensor& gradient_input,
1675 const tensor& dest,
1676 const tensor& src,
1677 tensor& grad
1678 )
1679 {
1680 DLIB_CASSERT(have_same_dimensions(gradient_input,dest));
1681 DLIB_CASSERT(have_same_dimensions(src,grad));
1682
1683 const float alpha = 1;
1684 const float beta = 1;
1685 CHECK_CUDNN(cudnnPoolingBackward(context(),
1686 (const cudnnPoolingDescriptor_t)handle,
1687 &alpha,
1688 descriptor(dest),
1689 dest.device(),
1690 descriptor(gradient_input),
1691 gradient_input.device(),
1692 descriptor(src),
1693 src.device(),
1694 &beta,
1695 descriptor(grad),
1696 grad.device()));
1697 }
1698
1699 // ------------------------------------------------------------------------------------
1700

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected