Show / Hide Table of Contents

    Class RNNDescriptor

    Inheritance
    System.Object
    RNNDescriptor
    Implements
    System.IDisposable
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: ManagedCuda.CudaDNN
    Assembly: CudaDNN.dll
    Syntax
    public class RNNDescriptor : IDisposable

    Constructors

    | Improve this Doc View Source

    RNNDescriptor(CudaDNNContext)

    Declaration
    public RNNDescriptor(CudaDNNContext context)
    Parameters
    Type Name Description
    CudaDNNContext context

    Properties

    | Improve this Doc View Source

    Desc

    Returns the inner handle.

    Declaration
    public cudnnRNNDescriptor Desc { get; }
    Property Value
    Type Description
    cudnnRNNDescriptor
    | Improve this Doc View Source

    MathType

    The math type specified in a given RNN descriptor.

    Declaration
    public cudnnMathType MathType { set; }
    Property Value
    Type Description
    cudnnMathType

    Methods

    | Improve this Doc View Source

    cudnnGetRNNParamsSize(TensorDescriptor, ref SizeT, cudnnDataType)

    This function is used to query the amount of parameter space required to execute the RNN described by rnnDesc with inputs dimensions defined by xDesc.

    Declaration
    public void cudnnGetRNNParamsSize(TensorDescriptor xDesc, ref SizeT sizeInBytes, cudnnDataType dataType)
    Parameters
    Type Name Description
    TensorDescriptor xDesc

    A fully packed tensor descriptor describing the input to one recurrent iteration.

    SizeT sizeInBytes

    Minimum amount of GPU memory needed as parameter space to be able to execute an RNN with the specified descriptor and input tensors.

    cudnnDataType dataType

    The data type of the parameters.

    | Improve this Doc View Source

    Dispose()

    Dispose

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Dispose(Boolean)

    For IDisposable

    Declaration
    protected virtual void Dispose(bool fDisposing)
    Parameters
    Type Name Description
    System.Boolean fDisposing
    | Improve this Doc View Source

    Finalize()

    For dispose

    Declaration
    protected void Finalize()
    | Improve this Doc View Source

    GetRNNLinLayerBiasParams(Int32, TensorDescriptor, FilterDescriptor, CudaDeviceVariable<Double>, Int32, FilterDescriptor, CudaDeviceVariable<SizeT>)

    This function is used to obtain a pointer and descriptor for the bias parameters in layer within the RNN described by rnnDesc with inputs dimensions defined by xDesc.

    Declaration
    public void GetRNNLinLayerBiasParams(int layer, TensorDescriptor xDesc, FilterDescriptor wDesc, CudaDeviceVariable<double> w, int linLayerID, FilterDescriptor linLayerBiasDesc, CudaDeviceVariable<SizeT> linLayerBias)
    Parameters
    Type Name Description
    System.Int32 layer

    The layer to query.

    TensorDescriptor xDesc

    A fully packed tensor descriptor describing the input to one recurrent iteration.

    FilterDescriptor wDesc

    Handle to a previously initialized filter descriptor describing the weights for the RNN.

    CudaDeviceVariable<System.Double> w

    Data pointer to GPU memory associated with the filter descriptor wDesc.

    System.Int32 linLayerID

    The linear layer to obtain information about:

    • If mode in rnnDesc was set to CUDNN_RNN_RELU or CUDNN_RNN_TANH a value of 0 references the bias applied to the input from the previous layer, a value of 1 references the bias applied to the recurrent input.
    • If mode in rnnDesc was set to CUDNN_LSTM values of 0, 1, 2 and 3 reference bias applied to the input from the previous layer, value of 4, 5, 6 and 7 reference bias applied to the recurrent input. ‣ Values 0 and 4 reference the input gate. ‣ Values 1 and 5 reference the forget gate. ‣ Values 2 and 6 reference the new memory gate. ‣ Values 3 and 7 reference the output gate.
    • If mode in rnnDesc was set to CUDNN_GRU values of 0, 1 and 2 reference bias applied to the input from the previous layer, value of 3, 4 and 5 reference bias applied to the recurrent input. ‣ Values 0 and 3 reference the reset gate. ‣ Values 1 and 4 reference the update gate. ‣ Values 2 and 5 reference the new memory gate.
    FilterDescriptor linLayerBiasDesc

    Handle to a previously created filter descriptor.

    CudaDeviceVariable<SizeT> linLayerBias

    Data pointer to GPU memory associated with the filter descriptor linLayerMatDesc.

    | Improve this Doc View Source

    GetRNNLinLayerBiasParams(Int32, TensorDescriptor, FilterDescriptor, CudaDeviceVariable<Single>, Int32, FilterDescriptor, CudaDeviceVariable<SizeT>)

    This function is used to obtain a pointer and descriptor for the bias parameters in layer within the RNN described by rnnDesc with inputs dimensions defined by xDesc.

    Declaration
    public void GetRNNLinLayerBiasParams(int layer, TensorDescriptor xDesc, FilterDescriptor wDesc, CudaDeviceVariable<float> w, int linLayerID, FilterDescriptor linLayerBiasDesc, CudaDeviceVariable<SizeT> linLayerBias)
    Parameters
    Type Name Description
    System.Int32 layer

    The layer to query.

    TensorDescriptor xDesc

    A fully packed tensor descriptor describing the input to one recurrent iteration.

    FilterDescriptor wDesc

    Handle to a previously initialized filter descriptor describing the weights for the RNN.

    CudaDeviceVariable<System.Single> w

    Data pointer to GPU memory associated with the filter descriptor wDesc.

    System.Int32 linLayerID

    The linear layer to obtain information about:

    • If mode in rnnDesc was set to CUDNN_RNN_RELU or CUDNN_RNN_TANH a value of 0 references the bias applied to the input from the previous layer, a value of 1 references the bias applied to the recurrent input.
    • If mode in rnnDesc was set to CUDNN_LSTM values of 0, 1, 2 and 3 reference bias applied to the input from the previous layer, value of 4, 5, 6 and 7 reference bias applied to the recurrent input. ‣ Values 0 and 4 reference the input gate. ‣ Values 1 and 5 reference the forget gate. ‣ Values 2 and 6 reference the new memory gate. ‣ Values 3 and 7 reference the output gate.
    • If mode in rnnDesc was set to CUDNN_GRU values of 0, 1 and 2 reference bias applied to the input from the previous layer, value of 3, 4 and 5 reference bias applied to the recurrent input. ‣ Values 0 and 3 reference the reset gate. ‣ Values 1 and 4 reference the update gate. ‣ Values 2 and 5 reference the new memory gate.
    FilterDescriptor linLayerBiasDesc

    Handle to a previously created filter descriptor.

    CudaDeviceVariable<SizeT> linLayerBias

    Data pointer to GPU memory associated with the filter descriptor linLayerMatDesc.

    | Improve this Doc View Source

    GetRNNLinLayerMatrixParams(Int32, TensorDescriptor, FilterDescriptor, CudaDeviceVariable<Double>, Int32, FilterDescriptor, CudaDeviceVariable<SizeT>)

    This function is used to obtain a pointer and descriptor for the matrix parameters in layer within the RNN described by rnnDesc with inputs dimensions defined by xDesc.

    Declaration
    public void GetRNNLinLayerMatrixParams(int layer, TensorDescriptor xDesc, FilterDescriptor wDesc, CudaDeviceVariable<double> w, int linLayerID, FilterDescriptor linLayerMatDesc, CudaDeviceVariable<SizeT> linLayerMat)
    Parameters
    Type Name Description
    System.Int32 layer

    The layer to query.

    TensorDescriptor xDesc

    A fully packed tensor descriptor describing the input to one recurrent iteration.

    FilterDescriptor wDesc

    Handle to a previously initialized filter descriptor describing the weights for the RNN.

    CudaDeviceVariable<System.Double> w

    Data pointer to GPU memory associated with the filter descriptor wDesc.

    System.Int32 linLayerID

    The linear layer to obtain information about:

    • If mode in rnnDesc was set to CUDNN_RNN_RELU or CUDNN_RNN_TANH a value of 0 references the matrix multiplication applied to the input from the previous layer, a value of 1 references the matrix multiplication applied to the recurrent input.
    • If mode in rnnDesc was set to CUDNN_LSTM values of 0-3 reference matrix multiplications applied to the input from the previous layer, value of 4-7 reference matrix multiplications applied to the recurrent input. ‣ Values 0 and 4 reference the input gate. ‣ Values 1 and 5 reference the forget gate. ‣ Values 2 and 6 reference the new memory gate. ‣ Values 3 and 7 reference the output gate.
    • If mode in rnnDesc was set to CUDNN_GRU values of 0-2 reference matrix multiplications applied to the input from the previous layer, value of 3-5 reference matrix multiplications applied to the recurrent input. ‣ Values 0 and 3 reference the reset gate. ‣ Values 1 and 4 reference the update gate. ‣ Values 2 and 5 reference the new memory gate.
    FilterDescriptor linLayerMatDesc

    Handle to a previously created filter descriptor.

    CudaDeviceVariable<SizeT> linLayerMat

    Data pointer to GPU memory associated with the filter descriptor linLayerMatDesc.

    | Improve this Doc View Source

    GetRNNLinLayerMatrixParams(Int32, TensorDescriptor, FilterDescriptor, CudaDeviceVariable<Single>, Int32, FilterDescriptor, CudaDeviceVariable<SizeT>)

    This function is used to obtain a pointer and descriptor for the matrix parameters in layer within the RNN described by rnnDesc with inputs dimensions defined by xDesc.

    Declaration
    public void GetRNNLinLayerMatrixParams(int layer, TensorDescriptor xDesc, FilterDescriptor wDesc, CudaDeviceVariable<float> w, int linLayerID, FilterDescriptor linLayerMatDesc, CudaDeviceVariable<SizeT> linLayerMat)
    Parameters
    Type Name Description
    System.Int32 layer

    The layer to query.

    TensorDescriptor xDesc

    A fully packed tensor descriptor describing the input to one recurrent iteration.

    FilterDescriptor wDesc

    Handle to a previously initialized filter descriptor describing the weights for the RNN.

    CudaDeviceVariable<System.Single> w

    Data pointer to GPU memory associated with the filter descriptor wDesc.

    System.Int32 linLayerID

    The linear layer to obtain information about:

    • If mode in rnnDesc was set to CUDNN_RNN_RELU or CUDNN_RNN_TANH a value of 0 references the matrix multiplication applied to the input from the previous layer, a value of 1 references the matrix multiplication applied to the recurrent input.
    • If mode in rnnDesc was set to CUDNN_LSTM values of 0-3 reference matrix multiplications applied to the input from the previous layer, value of 4-7 reference matrix multiplications applied to the recurrent input. ‣ Values 0 and 4 reference the input gate. ‣ Values 1 and 5 reference the forget gate. ‣ Values 2 and 6 reference the new memory gate. ‣ Values 3 and 7 reference the output gate.
    • If mode in rnnDesc was set to CUDNN_GRU values of 0-2 reference matrix multiplications applied to the input from the previous layer, value of 3-5 reference matrix multiplications applied to the recurrent input. ‣ Values 0 and 3 reference the reset gate. ‣ Values 1 and 4 reference the update gate. ‣ Values 2 and 5 reference the new memory gate.
    FilterDescriptor linLayerMatDesc

    Handle to a previously created filter descriptor.

    CudaDeviceVariable<SizeT> linLayerMat

    Data pointer to GPU memory associated with the filter descriptor linLayerMatDesc.

    | Improve this Doc View Source

    GetRNNTrainingReserveSize(Int32, TensorDescriptor[], ref SizeT)

    This function is used to query the amount of reserved space required for training the RNN described by rnnDesc with inputs dimensions defined by xDesc. The same reserve space must be passed to cudnnRNNForwardTraining, cudnnRNNBackwardData and cudnnRNNBackwardWeights.

    Declaration
    public void GetRNNTrainingReserveSize(int seqLength, TensorDescriptor[] xDesc, ref SizeT sizeInBytes)
    Parameters
    Type Name Description
    System.Int32 seqLength

    Number of iterations to unroll over.

    TensorDescriptor[] xDesc

    An array of tensor descriptors describing the input to each recurrent iteration.

    SizeT sizeInBytes

    Minimum amount of GPU memory needed as reserve space to be able to train an RNN with the specified descriptor and input tensors.

    | Improve this Doc View Source

    GetRNNWorkspaceSize(Int32, TensorDescriptor[], ref SizeT)

    This function is used to query the amount of work space required to execute the RNN described by rnnDesc with inputs dimensions defined by xDesc.

    Declaration
    public void GetRNNWorkspaceSize(int seqLength, TensorDescriptor[] xDesc, ref SizeT sizeInBytes)
    Parameters
    Type Name Description
    System.Int32 seqLength

    Number of iterations to unroll over.

    TensorDescriptor[] xDesc

    An array of tensor descriptors describing the input to each recurrent iteration.

    SizeT sizeInBytes

    Minimum amount of GPU memory needed as workspace to be able to execute an RNN with the specified descriptor and input tensors.

    | Improve this Doc View Source

    RNNBackwardData(TensorDescriptor[], CudaDeviceVariable<Double>, TensorDescriptor[], CudaDeviceVariable<Double>, TensorDescriptor, CudaDeviceVariable<Double>, TensorDescriptor, CudaDeviceVariable<Double>, FilterDescriptor, CudaDeviceVariable<Double>, TensorDescriptor, CudaDeviceVariable<Double>, TensorDescriptor, CudaDeviceVariable<Double>, TensorDescriptor[], CudaDeviceVariable<Double>, TensorDescriptor, CudaDeviceVariable<Double>, TensorDescriptor, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>, SizeT, CudaDeviceVariable<Byte>, SizeT)

    This routine executes the recurrent neural network described by rnnDesc with output gradients dy, dhy, dhc, weights w and input gradients dx, dhx, dcx. workspace is required for intermediate storage. The data in reserveSpace must have previously been generated by cudnnRNNForwardTraining. The same reserveSpace data must be used for future calls to cudnnRNNBackwardWeights if they execute on the same input data.

    Declaration
    public void RNNBackwardData(TensorDescriptor[] yDesc, CudaDeviceVariable<double> y, TensorDescriptor[] dyDesc, CudaDeviceVariable<double> dy, TensorDescriptor dhyDesc, CudaDeviceVariable<double> dhy, TensorDescriptor dcyDesc, CudaDeviceVariable<double> dcy, FilterDescriptor wDesc, CudaDeviceVariable<double> w, TensorDescriptor hxDesc, CudaDeviceVariable<double> hx, TensorDescriptor cxDesc, CudaDeviceVariable<double> cx, TensorDescriptor[] dxDesc, CudaDeviceVariable<double> dx, TensorDescriptor dhxDesc, CudaDeviceVariable<double> dhx, TensorDescriptor dcxDesc, CudaDeviceVariable<double> dcx, CudaDeviceVariable<byte> workspace, SizeT workSpaceSizeInBytes, CudaDeviceVariable<byte> reserveSpace, SizeT reserveSpaceSizeInBytes)
    Parameters
    Type Name Description
    TensorDescriptor[] yDesc

    An array of tensor descriptors describing the output from each recurrent iteration. The first dimension of the tensor depends on the direction argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc:

    • If direction is CUDNN_UNIDIRECTIONAL the first dimension should match the hiddenSize argument passed to cudnnSetRNNDescriptor.
    • If direction is CUDNN_BIDIRECTIONAL the first dimension should match double the hiddenSize argument passed to cudnnSetRNNDescriptor. The second dimension of the tensor n must match the second dimension of the tensor n in dyDesc. The tensor must be fully packed.
    CudaDeviceVariable<System.Double> y

    Data pointer to GPU memory associated with the output tensor descriptor yDesc.

    TensorDescriptor[] dyDesc

    An array of tensor descriptors describing the gradient at the output from each recurrent iteration. The first dimension of the tensor depends on the direction argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc:

    • If direction is CUDNN_UNIDIRECTIONAL the first dimension should match the hiddenSize argument passed to cudnnSetRNNDescriptor.
    • If direction is CUDNN_BIDIRECTIONAL the first dimension should match double the hiddenSize argument passed to cudnnSetRNNDescriptor. The second dimension of the tensor n must match the second dimension of the tensor n in dxDesc. The tensor must be fully packed.
    CudaDeviceVariable<System.Double> dy

    Data pointer to GPU memory associated with the tensor descriptors in the array dyDesc.

    TensorDescriptor dhyDesc

    Handle to a previously initialized tensor descriptor describing the gradients at the final hidden state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in dyDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> dhy

    Data pointer to GPU memory associated with the tensor descriptor dhyDesc. If a NULL pointer is passed, the gradients at the final hidden state of the network will be initialized to zero.

    TensorDescriptor dcyDesc

    Handle to a previously initialized tensor descriptor describing the gradients at the final cell state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in dyDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> dcy

    Data pointer to GPU memory associated with the tensor descriptor dcyDesc. If a NULL pointer is passed, the gradients at the final cell state of the network will be initialized to zero.

    FilterDescriptor wDesc

    Handle to a previously initialized filter descriptor describing the weights for the RNN.

    CudaDeviceVariable<System.Double> w

    Data pointer to GPU memory associated with the filter descriptor wDesc.

    TensorDescriptor hxDesc

    Handle to a previously initialized tensor descriptor describing the initial hidden state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> hx

    Data pointer to GPU memory associated with the tensor descriptor hxDesc. If a NULL pointer is passed, the initial hidden state of the network will be initialized to zero.

    TensorDescriptor cxDesc

    Handle to a previously initialized tensor descriptor describing the initial cell state for LSTM networks. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> cx

    Data pointer to GPU memory associated with the tensor descriptor cxDesc. If a NULL pointer is passed, the initial cell state of the network will be initialized to zero.

    TensorDescriptor[] dxDesc

    An array of tensor descriptors describing the gradient at the input of each recurrent iteration. Each tensor descriptor must have the same first dimension. The second dimension of the tensors may decrease from element n to element n+1 but may not increase. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> dx

    Data pointer to GPU memory associated with the tensor descriptors in the array dxDesc.

    TensorDescriptor dhxDesc

    Handle to a previously initialized tensor descriptor describing the gradient at the initial hidden state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> dhx

    Data pointer to GPU memory associated with the tensor descriptor dhxDesc. If a NULL pointer is passed, the gradient at the hidden input of the network will not be set.

    TensorDescriptor dcxDesc

    Handle to a previously initialized tensor descriptor describing the gradient at the initial cell state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> dcx

    Data pointer to GPU memory associated with the tensor descriptor dcxDesc. If a NULL pointer is passed, the gradient at the cell input of the network will not be set.

    CudaDeviceVariable<System.Byte> workspace

    Data pointer to GPU memory to be used as a workspace for this call.

    SizeT workSpaceSizeInBytes

    Specifies the size in bytes of the provided workspace.

    CudaDeviceVariable<System.Byte> reserveSpace

    Data pointer to GPU memory to be used as a reserve space for this call.

    SizeT reserveSpaceSizeInBytes

    Specifies the size in bytes of the provided reserveSpace.

    | Improve this Doc View Source

    RNNBackwardData(TensorDescriptor[], CudaDeviceVariable<Single>, TensorDescriptor[], CudaDeviceVariable<Single>, TensorDescriptor, CudaDeviceVariable<Single>, TensorDescriptor, CudaDeviceVariable<Single>, FilterDescriptor, CudaDeviceVariable<Single>, TensorDescriptor, CudaDeviceVariable<Single>, TensorDescriptor, CudaDeviceVariable<Single>, TensorDescriptor[], CudaDeviceVariable<Single>, TensorDescriptor, CudaDeviceVariable<Single>, TensorDescriptor, CudaDeviceVariable<Single>, CudaDeviceVariable<Byte>, SizeT, CudaDeviceVariable<Byte>, SizeT)

    This routine executes the recurrent neural network described by rnnDesc with output gradients dy, dhy, dhc, weights w and input gradients dx, dhx, dcx. workspace is required for intermediate storage. The data in reserveSpace must have previously been generated by cudnnRNNForwardTraining. The same reserveSpace data must be used for future calls to cudnnRNNBackwardWeights if they execute on the same input data.

    Declaration
    public void RNNBackwardData(TensorDescriptor[] yDesc, CudaDeviceVariable<float> y, TensorDescriptor[] dyDesc, CudaDeviceVariable<float> dy, TensorDescriptor dhyDesc, CudaDeviceVariable<float> dhy, TensorDescriptor dcyDesc, CudaDeviceVariable<float> dcy, FilterDescriptor wDesc, CudaDeviceVariable<float> w, TensorDescriptor hxDesc, CudaDeviceVariable<float> hx, TensorDescriptor cxDesc, CudaDeviceVariable<float> cx, TensorDescriptor[] dxDesc, CudaDeviceVariable<float> dx, TensorDescriptor dhxDesc, CudaDeviceVariable<float> dhx, TensorDescriptor dcxDesc, CudaDeviceVariable<float> dcx, CudaDeviceVariable<byte> workspace, SizeT workSpaceSizeInBytes, CudaDeviceVariable<byte> reserveSpace, SizeT reserveSpaceSizeInBytes)
    Parameters
    Type Name Description
    TensorDescriptor[] yDesc

    An array of tensor descriptors describing the output from each recurrent iteration. The first dimension of the tensor depends on the direction argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc:

    • If direction is CUDNN_UNIDIRECTIONAL the first dimension should match the hiddenSize argument passed to cudnnSetRNNDescriptor.
    • If direction is CUDNN_BIDIRECTIONAL the first dimension should match double the hiddenSize argument passed to cudnnSetRNNDescriptor. The second dimension of the tensor n must match the second dimension of the tensor n in dyDesc. The tensor must be fully packed.
    CudaDeviceVariable<System.Single> y

    Data pointer to GPU memory associated with the output tensor descriptor yDesc.

    TensorDescriptor[] dyDesc

    An array of tensor descriptors describing the gradient at the output from each recurrent iteration. The first dimension of the tensor depends on the direction argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc:

    • If direction is CUDNN_UNIDIRECTIONAL the first dimension should match the hiddenSize argument passed to cudnnSetRNNDescriptor.
    • If direction is CUDNN_BIDIRECTIONAL the first dimension should match double the hiddenSize argument passed to cudnnSetRNNDescriptor. The second dimension of the tensor n must match the second dimension of the tensor n in dxDesc. The tensor must be fully packed.
    CudaDeviceVariable<System.Single> dy

    Data pointer to GPU memory associated with the tensor descriptors in the array dyDesc.

    TensorDescriptor dhyDesc

    Handle to a previously initialized tensor descriptor describing the gradients at the final hidden state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in dyDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> dhy

    Data pointer to GPU memory associated with the tensor descriptor dhyDesc. If a NULL pointer is passed, the gradients at the final hidden state of the network will be initialized to zero.

    TensorDescriptor dcyDesc

    Handle to a previously initialized tensor descriptor describing the gradients at the final cell state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in dyDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> dcy

    Data pointer to GPU memory associated with the tensor descriptor dcyDesc. If a NULL pointer is passed, the gradients at the final cell state of the network will be initialized to zero.

    FilterDescriptor wDesc

    Handle to a previously initialized filter descriptor describing the weights for the RNN.

    CudaDeviceVariable<System.Single> w

    Data pointer to GPU memory associated with the filter descriptor wDesc.

    TensorDescriptor hxDesc

    Handle to a previously initialized tensor descriptor describing the initial hidden state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> hx

    Data pointer to GPU memory associated with the tensor descriptor hxDesc. If a NULL pointer is passed, the initial hidden state of the network will be initialized to zero.

    TensorDescriptor cxDesc

    Handle to a previously initialized tensor descriptor describing the initial cell state for LSTM networks. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> cx

    Data pointer to GPU memory associated with the tensor descriptor cxDesc. If a NULL pointer is passed, the initial cell state of the network will be initialized to zero.

    TensorDescriptor[] dxDesc

    An array of tensor descriptors describing the gradient at the input of each recurrent iteration. Each tensor descriptor must have the same first dimension. The second dimension of the tensors may decrease from element n to element n+1 but may not increase. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> dx

    Data pointer to GPU memory associated with the tensor descriptors in the array dxDesc.

    TensorDescriptor dhxDesc

    Handle to a previously initialized tensor descriptor describing the gradient at the initial hidden state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> dhx

    Data pointer to GPU memory associated with the tensor descriptor dhxDesc. If a NULL pointer is passed, the gradient at the hidden input of the network will not be set.

    TensorDescriptor dcxDesc

    Handle to a previously initialized tensor descriptor describing the gradient at the initial cell state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> dcx

    Data pointer to GPU memory associated with the tensor descriptor dcxDesc. If a NULL pointer is passed, the gradient at the cell input of the network will not be set.

    CudaDeviceVariable<System.Byte> workspace

    Data pointer to GPU memory to be used as a workspace for this call.

    SizeT workSpaceSizeInBytes

    Specifies the size in bytes of the provided workspace.

    CudaDeviceVariable<System.Byte> reserveSpace

    Data pointer to GPU memory to be used as a reserve space for this call.

    SizeT reserveSpaceSizeInBytes

    Specifies the size in bytes of the provided reserveSpace.

    | Improve this Doc View Source

    RNNBackwardWeights(TensorDescriptor[], CudaDeviceVariable<Double>, TensorDescriptor, CudaDeviceVariable<Double>, TensorDescriptor[], CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>, SizeT, FilterDescriptor, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>, SizeT)

    This routine accumulates weight gradients dw from the recurrent neural network described by rnnDesc with inputs x, hx, and outputs y. The mode of operation in this case is additive, the weight gradients calculated will be added to those already existing in dw. workspace is required for intermediate storage. The data in reserveSpace must have previously been generated by cudnnRNNBackwardData.

    Declaration
    public void RNNBackwardWeights(TensorDescriptor[] xDesc, CudaDeviceVariable<double> x, TensorDescriptor hxDesc, CudaDeviceVariable<double> hx, TensorDescriptor[] yDesc, CudaDeviceVariable<double> y, CudaDeviceVariable<byte> workspace, SizeT workSpaceSizeInBytes, FilterDescriptor dwDesc, CudaDeviceVariable<double> dw, CudaDeviceVariable<byte> reserveSpace, SizeT reserveSpaceSizeInBytes)
    Parameters
    Type Name Description
    TensorDescriptor[] xDesc

    An array of tensor descriptors describing the input to each recurrent iteration. Each tensor descriptor must have the same first dimension. The second dimension of the tensors may decrease from element n to element n+1 but may not increase. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> x

    Data pointer to GPU memory associated with the tensor descriptors in the array xDesc.

    TensorDescriptor hxDesc

    Handle to a previously initialized tensor descriptor describing the initial hidden state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> hx

    Data pointer to GPU memory associated with the tensor descriptor hxDesc. If a NULL pointer is passed, the initial hidden state of the network will be initialized to zero.

    TensorDescriptor[] yDesc

    An array of tensor descriptors describing the output from each recurrent iteration. The first dimension of the tensor depends on the direction argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc:

    • If direction is CUDNN_UNIDIRECTIONAL the first dimension should match the hiddenSize argument passed to cudnnSetRNNDescriptor.
    • If direction is CUDNN_BIDIRECTIONAL the first dimension should match double the hiddenSize argument passed to cudnnSetRNNDescriptor. The second dimension of the tensor n must match the second dimension of the tensor n in dyDesc. The tensor must be fully packed.
    CudaDeviceVariable<System.Double> y

    Data pointer to GPU memory associated with the output tensor descriptor yDesc.

    CudaDeviceVariable<System.Byte> workspace

    Data pointer to GPU memory to be used as a workspace for this call.

    SizeT workSpaceSizeInBytes

    Specifies the size in bytes of the provided workspace.

    FilterDescriptor dwDesc

    Handle to a previously initialized filter descriptor describing the gradients of the weights for the RNN.

    CudaDeviceVariable<System.Double> dw

    Data pointer to GPU memory associated with the filter descriptor dwDesc.

    CudaDeviceVariable<System.Byte> reserveSpace

    Data pointer to GPU memory to be used as a reserve space for this call.

    SizeT reserveSpaceSizeInBytes

    Specifies the size in bytes of the provided reserveSpace.

    | Improve this Doc View Source

    RNNBackwardWeights(TensorDescriptor[], CudaDeviceVariable<Single>, TensorDescriptor, CudaDeviceVariable<Single>, TensorDescriptor[], CudaDeviceVariable<Single>, CudaDeviceVariable<Byte>, SizeT, FilterDescriptor, CudaDeviceVariable<Single>, CudaDeviceVariable<Byte>, SizeT)

    This routine accumulates weight gradients dw from the recurrent neural network described by rnnDesc with inputs x, hx, and outputs y. The mode of operation in this case is additive, the weight gradients calculated will be added to those already existing in dw. workspace is required for intermediate storage. The data in reserveSpace must have previously been generated by cudnnRNNBackwardData.

    Declaration
    public void RNNBackwardWeights(TensorDescriptor[] xDesc, CudaDeviceVariable<float> x, TensorDescriptor hxDesc, CudaDeviceVariable<float> hx, TensorDescriptor[] yDesc, CudaDeviceVariable<float> y, CudaDeviceVariable<byte> workspace, SizeT workSpaceSizeInBytes, FilterDescriptor dwDesc, CudaDeviceVariable<float> dw, CudaDeviceVariable<byte> reserveSpace, SizeT reserveSpaceSizeInBytes)
    Parameters
    Type Name Description
    TensorDescriptor[] xDesc

    An array of tensor descriptors describing the input to each recurrent iteration. Each tensor descriptor must have the same first dimension. The second dimension of the tensors may decrease from element n to element n+1 but may not increase. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> x

    Data pointer to GPU memory associated with the tensor descriptors in the array xDesc.

    TensorDescriptor hxDesc

    Handle to a previously initialized tensor descriptor describing the initial hidden state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> hx

    Data pointer to GPU memory associated with the tensor descriptor hxDesc. If a NULL pointer is passed, the initial hidden state of the network will be initialized to zero.

    TensorDescriptor[] yDesc

    An array of tensor descriptors describing the output from each recurrent iteration. The first dimension of the tensor depends on the direction argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc:

    • If direction is CUDNN_UNIDIRECTIONAL the first dimension should match the hiddenSize argument passed to cudnnSetRNNDescriptor.
    • If direction is CUDNN_BIDIRECTIONAL the first dimension should match double the hiddenSize argument passed to cudnnSetRNNDescriptor. The second dimension of the tensor n must match the second dimension of the tensor n in dyDesc. The tensor must be fully packed.
    CudaDeviceVariable<System.Single> y

    Data pointer to GPU memory associated with the output tensor descriptor yDesc.

    CudaDeviceVariable<System.Byte> workspace

    Data pointer to GPU memory to be used as a workspace for this call.

    SizeT workSpaceSizeInBytes

    Specifies the size in bytes of the provided workspace.

    FilterDescriptor dwDesc

    Handle to a previously initialized filter descriptor describing the gradients of the weights for the RNN.

    CudaDeviceVariable<System.Single> dw

    Data pointer to GPU memory associated with the filter descriptor dwDesc.

    CudaDeviceVariable<System.Byte> reserveSpace

    Data pointer to GPU memory to be used as a reserve space for this call.

    SizeT reserveSpaceSizeInBytes

    Specifies the size in bytes of the provided reserveSpace.

    | Improve this Doc View Source

    RNNForwardInference(TensorDescriptor[], CudaDeviceVariable<Double>, TensorDescriptor, CudaDeviceVariable<Double>, TensorDescriptor, CudaDeviceVariable<Double>, FilterDescriptor, CudaDeviceVariable<Double>, TensorDescriptor[], CudaDeviceVariable<Double>, TensorDescriptor, CudaDeviceVariable<Double>, TensorDescriptor, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>, SizeT)

    This routine executes the recurrent neural network described by rnnDesc with inputs x, hx, cx, weights w and outputs y, hy, cy. workspace is required for intermediate storage. This function does not store data required for training; cudnnRNNForwardTraining should be used for that purpose.

    Declaration
    public void RNNForwardInference(TensorDescriptor[] xDesc, CudaDeviceVariable<double> x, TensorDescriptor hxDesc, CudaDeviceVariable<double> hx, TensorDescriptor cxDesc, CudaDeviceVariable<double> cx, FilterDescriptor wDesc, CudaDeviceVariable<double> w, TensorDescriptor[] yDesc, CudaDeviceVariable<double> y, TensorDescriptor hyDesc, CudaDeviceVariable<double> hy, TensorDescriptor cyDesc, CudaDeviceVariable<double> cy, CudaDeviceVariable<byte> workspace, SizeT workSpaceSizeInBytes)
    Parameters
    Type Name Description
    TensorDescriptor[] xDesc

    An array of tensor descriptors describing the input to each recurrent iteration. Each tensor descriptor must have the same first dimension. The second dimension of the tensors may decrease from element n to element n+1 but may not increase. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> x

    Data pointer to GPU memory associated with the tensor descriptors in the array xDesc. The data are expected to be packed contiguously with the first element of iteration n+1 following directly from the last element of iteration n.

    TensorDescriptor hxDesc

    Handle to a previously initialized tensor descriptor describing the initial hidden state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> hx

    Data pointer to GPU memory associated with the tensor descriptor hxDesc. If a NULL pointer is passed, the initial hidden state of the network will be initialized to zero.

    TensorDescriptor cxDesc

    Handle to a previously initialized tensor descriptor describing the initial cell state for LSTM networks. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> cx

    Data pointer to GPU memory associated with the tensor descriptor cxDesc. If a NULL pointer is passed, the initial cell state of the network will be initialized to zero.

    FilterDescriptor wDesc

    Handle to a previously initialized filter descriptor describing the weights for the RNN.

    CudaDeviceVariable<System.Double> w

    Data pointer to GPU memory associated with the filter descriptor wDesc.

    TensorDescriptor[] yDesc

    An array of tensor descriptors describing the output from each recurrent iteration. The first dimension of the tensor depends on the direction argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc:

    • If direction is CUDNN_UNIDIRECTIONAL the first dimension should match the hiddenSize argument passed to cudnnSetRNNDescriptor.
    • If direction is CUDNN_BIDIRECTIONAL the first dimension should match double the hiddenSize argument passed to cudnnSetRNNDescriptor. The second dimension of the tensor n must match the second dimension of the tensor n in xDesc. The tensor must be fully packed.
    CudaDeviceVariable<System.Double> y

    Data pointer to GPU memory associated with the output tensor descriptor yDesc. The data are expected to be packed contiguously with the first element of iteration n+1 following directly from the last element of iteration n.

    TensorDescriptor hyDesc

    Handle to a previously initialized tensor descriptor describing the final hidden state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> hy

    Data pointer to GPU memory associated with the tensor descriptor hyDesc. If a NULL pointer is passed, the final hidden state of the network will not be saved.

    TensorDescriptor cyDesc

    Handle to a previously initialized tensor descriptor describing the final cell state for LSTM networks. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> cy

    Data pointer to GPU memory associated with the tensor descriptor cyDesc. If a NULL pointer is passed, the final cell state of the network will be not be saved.

    CudaDeviceVariable<System.Byte> workspace

    Data pointer to GPU memory to be used as a workspace for this call.

    SizeT workSpaceSizeInBytes

    Specifies the size in bytes of the provided workspace.

    | Improve this Doc View Source

    RNNForwardInference(TensorDescriptor[], CudaDeviceVariable<Single>, TensorDescriptor, CudaDeviceVariable<Single>, TensorDescriptor, CudaDeviceVariable<Single>, FilterDescriptor, CudaDeviceVariable<Single>, TensorDescriptor[], CudaDeviceVariable<Single>, TensorDescriptor, CudaDeviceVariable<Single>, TensorDescriptor, CudaDeviceVariable<Single>, CudaDeviceVariable<Byte>, SizeT)

    This routine executes the recurrent neural network described by rnnDesc with inputs x, hx, cx, weights w and outputs y, hy, cy. workspace is required for intermediate storage. This function does not store data required for training; cudnnRNNForwardTraining should be used for that purpose.

    Declaration
    public void RNNForwardInference(TensorDescriptor[] xDesc, CudaDeviceVariable<float> x, TensorDescriptor hxDesc, CudaDeviceVariable<float> hx, TensorDescriptor cxDesc, CudaDeviceVariable<float> cx, FilterDescriptor wDesc, CudaDeviceVariable<float> w, TensorDescriptor[] yDesc, CudaDeviceVariable<float> y, TensorDescriptor hyDesc, CudaDeviceVariable<float> hy, TensorDescriptor cyDesc, CudaDeviceVariable<float> cy, CudaDeviceVariable<byte> workspace, SizeT workSpaceSizeInBytes)
    Parameters
    Type Name Description
    TensorDescriptor[] xDesc

    An array of tensor descriptors describing the input to each recurrent iteration. Each tensor descriptor must have the same first dimension. The second dimension of the tensors may decrease from element n to element n+1 but may not increase. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> x

    Data pointer to GPU memory associated with the tensor descriptors in the array xDesc. The data are expected to be packed contiguously with the first element of iteration n+1 following directly from the last element of iteration n.

    TensorDescriptor hxDesc

    Handle to a previously initialized tensor descriptor describing the initial hidden state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> hx

    Data pointer to GPU memory associated with the tensor descriptor hxDesc. If a NULL pointer is passed, the initial hidden state of the network will be initialized to zero.

    TensorDescriptor cxDesc

    Handle to a previously initialized tensor descriptor describing the initial cell state for LSTM networks. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> cx

    Data pointer to GPU memory associated with the tensor descriptor cxDesc. If a NULL pointer is passed, the initial cell state of the network will be initialized to zero.

    FilterDescriptor wDesc

    Handle to a previously initialized filter descriptor describing the weights for the RNN.

    CudaDeviceVariable<System.Single> w

    Data pointer to GPU memory associated with the filter descriptor wDesc.

    TensorDescriptor[] yDesc

    An array of tensor descriptors describing the output from each recurrent iteration. The first dimension of the tensor depends on the direction argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc:

    • If direction is CUDNN_UNIDIRECTIONAL the first dimension should match the hiddenSize argument passed to cudnnSetRNNDescriptor.
    • If direction is CUDNN_BIDIRECTIONAL the first dimension should match double the hiddenSize argument passed to cudnnSetRNNDescriptor. The second dimension of the tensor n must match the second dimension of the tensor n in xDesc. The tensor must be fully packed.
    CudaDeviceVariable<System.Single> y

    Data pointer to GPU memory associated with the output tensor descriptor yDesc. The data are expected to be packed contiguously with the first element of iteration n+1 following directly from the last element of iteration n.

    TensorDescriptor hyDesc

    Handle to a previously initialized tensor descriptor describing the final hidden state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> hy

    Data pointer to GPU memory associated with the tensor descriptor hyDesc. If a NULL pointer is passed, the final hidden state of the network will not be saved.

    TensorDescriptor cyDesc

    Handle to a previously initialized tensor descriptor describing the final cell state for LSTM networks. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> cy

    Data pointer to GPU memory associated with the tensor descriptor cyDesc. If a NULL pointer is passed, the final cell state of the network will be not be saved.

    CudaDeviceVariable<System.Byte> workspace

    Data pointer to GPU memory to be used as a workspace for this call.

    SizeT workSpaceSizeInBytes

    Specifies the size in bytes of the provided workspace.

    | Improve this Doc View Source

    RNNForwardTraining(TensorDescriptor[], CudaDeviceVariable<Double>, TensorDescriptor, CudaDeviceVariable<Double>, TensorDescriptor, CudaDeviceVariable<Double>, FilterDescriptor, CudaDeviceVariable<Double>, TensorDescriptor[], CudaDeviceVariable<Double>, TensorDescriptor, CudaDeviceVariable<Double>, TensorDescriptor, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>, SizeT, CudaDeviceVariable<Byte>, SizeT)

    This routine executes the recurrent neural network described by rnnDesc with inputs x, hx, cx, weights w and outputs y, hy, cy. workspace is required for intermediate storage. reserveSpace stores data required for training. The same reserveSpace data must be used for future calls to cudnnRNNBackwardData and cudnnRNNBackwardWeights if these execute on the same input data.

    Declaration
    public void RNNForwardTraining(TensorDescriptor[] xDesc, CudaDeviceVariable<double> x, TensorDescriptor hxDesc, CudaDeviceVariable<double> hx, TensorDescriptor cxDesc, CudaDeviceVariable<double> cx, FilterDescriptor wDesc, CudaDeviceVariable<double> w, TensorDescriptor[] yDesc, CudaDeviceVariable<double> y, TensorDescriptor hyDesc, CudaDeviceVariable<double> hy, TensorDescriptor cyDesc, CudaDeviceVariable<double> cy, CudaDeviceVariable<byte> workspace, SizeT workSpaceSizeInBytes, CudaDeviceVariable<byte> reserveSpace, SizeT reserveSpaceSizeInBytes)
    Parameters
    Type Name Description
    TensorDescriptor[] xDesc

    An array of tensor descriptors describing the input to each recurrent iteration. Each tensor descriptor must have the same first dimension. The second dimension of the tensors may decrease from element n to element n+1 but may not increase. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> x

    Data pointer to GPU memory associated with the tensor descriptors in the array xDesc.

    TensorDescriptor hxDesc

    Handle to a previously initialized tensor descriptor describing the initial hidden state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> hx

    Data pointer to GPU memory associated with the tensor descriptor hxDesc. If a NULL pointer is passed, the initial hidden state of the network will be initialized to zero.

    TensorDescriptor cxDesc

    Handle to a previously initialized tensor descriptor describing the initial cell state for LSTM networks. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> cx

    Data pointer to GPU memory associated with the tensor descriptor cxDesc. If a NULL pointer is passed, the initial cell state of the network will be initialized to zero.

    FilterDescriptor wDesc

    Handle to a previously initialized filter descriptor describing the weights for the RNN.

    CudaDeviceVariable<System.Double> w

    Data pointer to GPU memory associated with the filter descriptor wDesc.

    TensorDescriptor[] yDesc

    An array of tensor descriptors describing the output from each recurrent iteration. The first dimension of the tensor depends on the direction argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc:

    • If direction is CUDNN_UNIDIRECTIONAL the first dimension should match the hiddenSize argument passed to cudnnSetRNNDescriptor.
    • If direction is CUDNN_BIDIRECTIONAL the first dimension should match double the hiddenSize argument passed to cudnnSetRNNDescriptor. The second dimension of the tensor n must match the second dimension of the tensor n in xDesc. The tensor must be fully packed.
    CudaDeviceVariable<System.Double> y

    Data pointer to GPU memory associated with the output tensor descriptor yDesc.

    TensorDescriptor hyDesc

    Handle to a previously initialized tensor descriptor describing the final hidden state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> hy

    Data pointer to GPU memory associated with the tensor descriptor hyDesc. If a NULL pointer is passed, the final hidden state of the network will not be saved.

    TensorDescriptor cyDesc

    Handle to a previously initialized tensor descriptor describing the final cell state for LSTM networks. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Double> cy

    Data pointer to GPU memory associated with the tensor descriptor cyDesc. If a NULL pointer is passed, the final cell state of the network will be not be saved.

    CudaDeviceVariable<System.Byte> workspace

    Data pointer to GPU memory to be used as a workspace for this call.

    SizeT workSpaceSizeInBytes

    Specifies the size in bytes of the provided workspace.

    CudaDeviceVariable<System.Byte> reserveSpace

    Data pointer to GPU memory to be used as a reserve space for this call.

    SizeT reserveSpaceSizeInBytes

    Specifies the size in bytes of the provided reserveSpace.

    | Improve this Doc View Source

    RNNForwardTraining(TensorDescriptor[], CudaDeviceVariable<Single>, TensorDescriptor, CudaDeviceVariable<Single>, TensorDescriptor, CudaDeviceVariable<Single>, FilterDescriptor, CudaDeviceVariable<Single>, TensorDescriptor[], CudaDeviceVariable<Single>, TensorDescriptor, CudaDeviceVariable<Single>, TensorDescriptor, CudaDeviceVariable<Single>, CudaDeviceVariable<Byte>, SizeT, CudaDeviceVariable<Byte>, SizeT)

    This routine executes the recurrent neural network described by rnnDesc with inputs x, hx, cx, weights w and outputs y, hy, cy. workspace is required for intermediate storage. reserveSpace stores data required for training. The same reserveSpace data must be used for future calls to cudnnRNNBackwardData and cudnnRNNBackwardWeights if these execute on the same input data.

    Declaration
    public void RNNForwardTraining(TensorDescriptor[] xDesc, CudaDeviceVariable<float> x, TensorDescriptor hxDesc, CudaDeviceVariable<float> hx, TensorDescriptor cxDesc, CudaDeviceVariable<float> cx, FilterDescriptor wDesc, CudaDeviceVariable<float> w, TensorDescriptor[] yDesc, CudaDeviceVariable<float> y, TensorDescriptor hyDesc, CudaDeviceVariable<float> hy, TensorDescriptor cyDesc, CudaDeviceVariable<float> cy, CudaDeviceVariable<byte> workspace, SizeT workSpaceSizeInBytes, CudaDeviceVariable<byte> reserveSpace, SizeT reserveSpaceSizeInBytes)
    Parameters
    Type Name Description
    TensorDescriptor[] xDesc

    An array of tensor descriptors describing the input to each recurrent iteration. Each tensor descriptor must have the same first dimension. The second dimension of the tensors may decrease from element n to element n+1 but may not increase. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> x

    Data pointer to GPU memory associated with the tensor descriptors in the array xDesc.

    TensorDescriptor hxDesc

    Handle to a previously initialized tensor descriptor describing the initial hidden state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> hx

    Data pointer to GPU memory associated with the tensor descriptor hxDesc. If a NULL pointer is passed, the initial hidden state of the network will be initialized to zero.

    TensorDescriptor cxDesc

    Handle to a previously initialized tensor descriptor describing the initial cell state for LSTM networks. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> cx

    Data pointer to GPU memory associated with the tensor descriptor cxDesc. If a NULL pointer is passed, the initial cell state of the network will be initialized to zero.

    FilterDescriptor wDesc

    Handle to a previously initialized filter descriptor describing the weights for the RNN.

    CudaDeviceVariable<System.Single> w

    Data pointer to GPU memory associated with the filter descriptor wDesc.

    TensorDescriptor[] yDesc

    An array of tensor descriptors describing the output from each recurrent iteration. The first dimension of the tensor depends on the direction argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc:

    • If direction is CUDNN_UNIDIRECTIONAL the first dimension should match the hiddenSize argument passed to cudnnSetRNNDescriptor.
    • If direction is CUDNN_BIDIRECTIONAL the first dimension should match double the hiddenSize argument passed to cudnnSetRNNDescriptor. The second dimension of the tensor n must match the second dimension of the tensor n in xDesc. The tensor must be fully packed.
    CudaDeviceVariable<System.Single> y

    Data pointer to GPU memory associated with the output tensor descriptor yDesc.

    TensorDescriptor hyDesc

    Handle to a previously initialized tensor descriptor describing the final hidden state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> hy

    Data pointer to GPU memory associated with the tensor descriptor hyDesc. If a NULL pointer is passed, the final hidden state of the network will not be saved.

    TensorDescriptor cyDesc

    Handle to a previously initialized tensor descriptor describing the final cell state for LSTM networks. The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.

    CudaDeviceVariable<System.Single> cy

    Data pointer to GPU memory associated with the tensor descriptor cyDesc. If a NULL pointer is passed, the final cell state of the network will be not be saved.

    CudaDeviceVariable<System.Byte> workspace

    Data pointer to GPU memory to be used as a workspace for this call.

    SizeT workSpaceSizeInBytes

    Specifies the size in bytes of the provided workspace.

    CudaDeviceVariable<System.Byte> reserveSpace

    Data pointer to GPU memory to be used as a reserve space for this call.

    SizeT reserveSpaceSizeInBytes

    Specifies the size in bytes of the provided reserveSpace.

    | Improve this Doc View Source

    SetPersistentRNNPlan(PersistentRNNPlan)

    This function sets the persistent RNN plan to be executed when using rnnDesc and CUDNN_RNN_ALGO_PERSIST_DYNAMIC algo.

    Declaration
    public void SetPersistentRNNPlan(PersistentRNNPlan plan)
    Parameters
    Type Name Description
    PersistentRNNPlan plan
    | Improve this Doc View Source

    SetRNNDescriptor(CudaDNNContext, Int32, Int32, DropoutDescriptor, cudnnRNNInputMode, cudnnDirectionMode, cudnnRNNMode, cudnnRNNAlgo, cudnnDataType)

    This function initializes a previously created RNN descriptor object.

    Declaration
    public void SetRNNDescriptor(CudaDNNContext ctx, int hiddenSize, int numLayers, DropoutDescriptor dropoutDesc, cudnnRNNInputMode inputMode, cudnnDirectionMode direction, cudnnRNNMode mode, cudnnRNNAlgo algo, cudnnDataType dataType)
    Parameters
    Type Name Description
    CudaDNNContext ctx

    Handle to a previously created cuDNN library descriptor.

    System.Int32 hiddenSize

    Size of the internal hidden state for each layer.

    System.Int32 numLayers

    Number of layers.

    DropoutDescriptor dropoutDesc

    Handle to a previously created and initialized dropout descriptor.

    cudnnRNNInputMode inputMode

    Specifies the behavior at the input to the first layer.

    cudnnDirectionMode direction

    Specifies the recurrence pattern. (eg. bidirectional)

    cudnnRNNMode mode

    The type of RNN to compute.

    cudnnRNNAlgo algo

    Specifies which RNN algorithm should be used to compute the results.

    cudnnDataType dataType

    Math precision.

    Implements

    System.IDisposable
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX