pub fn add_assign<CompT, T1, F1, T2, F2, const D: usize>(
        &self,
        alpha: CompT,
        a: &Tensor<T1, F1, impl GpuBuffer<T1>, D>,
        gamma: CompT,
        c: &mut Tensor<T2, F2, impl GpuBuffer<T2>, D>,
    ) -> Result<(), CudnnError>
    where
        CompT: DataType + SupportedOp<T1, T1, T2>,
        T1: DataType,
        F1: TensorFormat + SupportedType<T1>,
        T2: DataType,
        F2: TensorFormat + SupportedType<T2>,
    {
        let a_data = a.data().as_device_ptr().as_raw();
        let a_desc = a.descriptor();

        let c_data = c.data().as_device_ptr().as_raw();
        let c_desc = c.descriptor();

        unsafe {
            sys::cudnnAddTensor(
                self.raw,
                &alpha as *const CompT as *const std::ffi::c_void,
                a_desc.raw,
                a_data as *const std::ffi::c_void,
                &gamma as *const CompT as *const std::ffi::c_void,
                c_desc.raw,
                c_data as *mut std::ffi::c_void,
            )
            .into_result()
        }
    }
/// This function adds two tensors in-place according to the following equation:
///
/// C = alpha * A + gamma * C
///
/// given the tensors A and C, and the scaling parameters alpha and gamma.
///
/// # Arguments
///
/// * `alpha` - scaling factor for the operand.
///
/// * `a` - operand.
///
/// * `gamma` - scaling factor for the destination tensor.
///
/// * `c` - destination tensor. This tensor is written after being read.
///
/// **Do note** that the scaling factors must be stored in host memory. All tensor formats up
/// to dimension five (5) are supported. This routine does not support tensor formats beyond
/// these dimensions.
This function adds two tensors in-place according to the following equation:
C = alpha * A + gamma * C

given the tensors A and C, and the scaling parameters alpha and gamma.
This function adds two tensors in - place according to the following equation : C = alpha * A + gamma * C given the tensors A and C and the scaling parameters alpha and gamma .
pub fn add_assign<CompT, T1, F1, T2, F2, const D: usize>(
        &self,
        alpha: CompT,
        a: &Tensor<T1, F1, impl GpuBuffer<T1>, D>,
        gamma: CompT,
        c: &mut Tensor<T2, F2, impl GpuBuffer<T2>, D>,
    ) -> Result<(), CudnnError>
    where
        CompT: DataType + SupportedOp<T1, T1, T2>,
        T1: DataType,
        F1: TensorFormat + SupportedType<T1>,
        T2: DataType,
        F2: TensorFormat + SupportedType<T2>,
    {
        let a_data = a.data().as_device_ptr().as_raw();
        let a_desc = a.descriptor();
        let c_data = c.data().as_device_ptr().as_raw();
        let c_desc = c.descriptor();
        unsafe {
            sys::cudnnAddTensor(
                self.raw,
                &alpha as *const CompT as *const std::ffi::c_void,
                a_desc.raw,
                a_data as *const std::ffi::c_void,
                &gamma as *const CompT as *const std::ffi::c_void,
                c_desc.raw,
                c_data as *mut std::ffi::c_void,
            )
            .into_result()
        }
    }
pub fn add_assign < CompT , T1 , F1 , T2 , F2 , const D : usize > ( & self , alpha : CompT , a : & Tensor < T1 , F1 , impl GpuBuffer < T1 > , D > , gamma : CompT , c : & mut Tensor < T2 , F2 , impl GpuBuffer < T2 > , D > , ) -> Result < ( ) , CudnnError > where CompT : DataType + SupportedOp < T1 , T1 , T2 > , T1 : DataType , F1 : TensorFormat + SupportedType < T1 > , T2 : DataType , F2 : TensorFormat + SupportedType < T2 > , { let a_data = a . data ( ) . as_device_ptr ( ) . as_raw ( ) ; let a_desc = a . descriptor ( ) ; let c_data = c . data ( ) . as_device_ptr ( ) . as_raw ( ) ; let c_desc = c . descriptor ( ) ; unsafe { sys :: cudnnAddTensor ( self . raw , & alpha as * const CompT as * const std :: ffi :: c_void , a_desc . raw , a_data as * const std :: ffi :: c_void , & gamma as * const CompT as * const std :: ffi :: c_void , c_desc . raw , c_data as * mut std :: ffi :: c_void , ) . into_result ( ) } }
This function adds two tensors in-place according to the following equation:
C = alpha * A + gamma * C
This function adds two tensors in - place according to the following equation : C = alpha * A + gamma * C
&self
alpha
CompT
a
&Tensor<T1, F1, impl GpuBuffer<T1>, D>
gamma
CompT
c
&mut Tensor<T2, F2, impl GpuBuffer<T2>, D>
&self
alpha
CompT
a
&Tensor<T1, F1, impl GpuBuffer<T1>, D>
gamma
CompT
c
&mut Tensor<T2, F2, impl GpuBuffer<T2>, D>