pub fn dropout_backward<T, F1, F2, const D: usize>(
        &self,
        dropout_desc: &DropoutDescriptor<impl GpuBuffer<u8>>,
        dy: &Tensor<T, F1, impl GpuBuffer<T>, D>,
        dx: &mut Tensor<T, F2, impl GpuBuffer<T>, D>,
        reserve_space: &mut impl GpuBuffer<u8>,
    ) -> Result<(), CudnnError>
    where
        T: DataType,
        F1: TensorFormat + SupportedType<T>,
        F2: TensorFormat + SupportedType<T>,
    {
        let dy_desc = dy.descriptor();
        let dy_data = dy.data().as_device_ptr().as_raw();

        let dx_desc = dx.descriptor();
        let dx_data = dx.data().as_device_ptr().as_raw_mut();

        let reserve_space_ptr = reserve_space.as_device_ptr().as_raw_mut();

        unsafe {
            sys::cudnnDropoutBackward(
                self.raw,
                dropout_desc.raw,
                dy_desc.raw,
                dy_data as *const std::ffi::c_void,
                dx_desc.raw,
                dx_data as *mut std::ffi::c_void,
                reserve_space_ptr as *mut std::ffi::c_void,
                reserve_space.len(),
            )
            .into_result()
        }
    }
/// This function performs backward dropout operation over `dy` returning results in `dx`.
///
/// If during forward dropout operation value from `x` was propagated to `y` then
/// during backward operation value from `dy` will be propagated to `dx`, otherwise, `dx`
/// value will be set to 0.
///
/// # Arguments
///
/// * `dropout_descriptor` - previously created dropout descriptor.
///
/// * `dy` - input tensor.
///
/// * `dx` - destination tensor.
///
/// * `reserve_space` - user-allocated GPU memory used by this function. It is expected that the
/// contents of reserveSpace does not change between `dropout_forward()` and
/// `dropout_backward()` calls.
///
/// # Errors
///
/// Returns an error if the number of elements in `dx` and `dy` differs and if `reserve_space`
/// is less than the value returned by `get_dropout_reserve_space_size`.
This function performs backward dropout operation over `dy` returning results in `dx`.
This function performs backward dropout operation over ` dy ` returning results in ` dx ` .
pub fn dropout_backward<T, F1, F2, const D: usize>(
        &self,
        dropout_desc: &DropoutDescriptor<impl GpuBuffer<u8>>,
        dy: &Tensor<T, F1, impl GpuBuffer<T>, D>,
        dx: &mut Tensor<T, F2, impl GpuBuffer<T>, D>,
        reserve_space: &mut impl GpuBuffer<u8>,
    ) -> Result<(), CudnnError>
    where
        T: DataType,
        F1: TensorFormat + SupportedType<T>,
        F2: TensorFormat + SupportedType<T>,
    {
        let dy_desc = dy.descriptor();
        let dy_data = dy.data().as_device_ptr().as_raw();
        let dx_desc = dx.descriptor();
        let dx_data = dx.data().as_device_ptr().as_raw_mut();
        let reserve_space_ptr = reserve_space.as_device_ptr().as_raw_mut();
        unsafe {
            sys::cudnnDropoutBackward(
                self.raw,
                dropout_desc.raw,
                dy_desc.raw,
                dy_data as *const std::ffi::c_void,
                dx_desc.raw,
                dx_data as *mut std::ffi::c_void,
                reserve_space_ptr as *mut std::ffi::c_void,
                reserve_space.len(),
            )
            .into_result()
        }
    }
pub fn dropout_backward < T , F1 , F2 , const D : usize > ( & self , dropout_desc : & DropoutDescriptor < impl GpuBuffer < u8 > > , dy : & Tensor < T , F1 , impl GpuBuffer < T > , D > , dx : & mut Tensor < T , F2 , impl GpuBuffer < T > , D > , reserve_space : & mut impl GpuBuffer < u8 > , ) -> Result < ( ) , CudnnError > where T : DataType , F1 : TensorFormat + SupportedType < T > , F2 : TensorFormat + SupportedType < T > , { let dy_desc = dy . descriptor ( ) ; let dy_data = dy . data ( ) . as_device_ptr ( ) . as_raw ( ) ; let dx_desc = dx . descriptor ( ) ; let dx_data = dx . data ( ) . as_device_ptr ( ) . as_raw_mut ( ) ; let reserve_space_ptr = reserve_space . as_device_ptr ( ) . as_raw_mut ( ) ; unsafe { sys :: cudnnDropoutBackward ( self . raw , dropout_desc . raw , dy_desc . raw , dy_data as * const std :: ffi :: c_void , dx_desc . raw , dx_data as * mut std :: ffi :: c_void , reserve_space_ptr as * mut std :: ffi :: c_void , reserve_space . len ( ) , ) . into_result ( ) } }
This function performs backward dropout operation over `dy` returning results in `dx`.
This function performs backward dropout operation over ` dy ` returning results in ` dx ` .
&self
dropout_desc
&DropoutDescriptor<impl GpuBuffer<u8>>
dy
&Tensor<T, F1, impl GpuBuffer<T>, D>
dx
&mut Tensor<T, F2, impl GpuBuffer<T>, D>
reserve_space
&mut impl GpuBuffer<u8>
&self
dropout_desc
&DropoutDescriptor<impl GpuBuffer<u8>>
dy
&Tensor<T, F1, impl GpuBuffer<T>, D>
dx
&mut Tensor<T, F2, impl GpuBuffer<T>, D>
reserve_space
&mut impl GpuBuffer<u8>
errors
Returns an error if the number of elements in `dx` and `dy` differs and if `reserve_space`
is less than the value returned by `get_dropout_reserve_space_size`.
Returns an error if the number of elements in ` dx ` and ` dy ` differs and if ` reserve_space ` is less than the value returned by ` get_dropout_reserve_space_size ` .