Library/ManagedCuda/CudaDNN/CudaDNNContext.cs
/// <summary>
/// This function initializes a previously created RNN descriptor object.
/// </summary>
/// <param name="rnnDesc">A previously created RNN descriptor.</param>
/// <param name="hiddenSize">Size of the internal hidden state for each layer.</param>
/// <param name="numLayers">Number of stacked layers.</param>
/// <param name="dropoutDesc">Handle to a previously created and initialized dropout descriptor.
/// Dropout will be applied between layers(eg.a single layer network will have no dropout applied).</param>
/// <param name="inputMode">Specifies the behavior at the input to the first layer</param>
/// <param name="direction">Specifies the recurrence pattern. (eg. bidirectional)</param>
/// <param name="mode">Specifies the type of RNN to compute.</param>
/// <param name="algo">Specifies which RNN algorithm should be used to compute the results.</param>
/// <param name="dataType">Compute precision.</param>
This function initializes a previously created RNN descriptor object.
This function initializes a previously created RNN descriptor object .
public void SetRNNDescriptor(
                                                RNNDescriptor rnnDesc,
                                                int hiddenSize,
                                                int numLayers,
                                                DropoutDescriptor dropoutDesc, 
                                                cudnnRNNInputMode inputMode,
                                                cudnnDirectionMode direction,
                                                cudnnRNNMode mode,
                                                cudnnRNNAlgo algo,
                                                cudnnDataType dataType)
        {
            res = CudaDNNNativeMethods.cudnnSetRNNDescriptor(_handle, rnnDesc.Desc, hiddenSize, numLayers, dropoutDesc.Desc, inputMode, direction, mode, algo, dataType);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSetRNNDescriptor", res));
            if (res != cudnnStatus.Success) throw new CudaDNNException(res);
        }
public void SetRNNDescriptor ( RNNDescriptor rnnDesc , int hiddenSize , int numLayers , DropoutDescriptor dropoutDesc , cudnnRNNInputMode inputMode , cudnnDirectionMode direction , cudnnRNNMode mode , cudnnRNNAlgo algo , cudnnDataType dataType ) { res = CudaDNNNativeMethods . cudnnSetRNNDescriptor ( _handle , rnnDesc . Desc , hiddenSize , numLayers , dropoutDesc . Desc , inputMode , direction , mode , algo , dataType ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != cudnnStatus . Success ) throw new CudaDNNException ( res ) ; }
This function initializes a previously created RNN descriptor object.
This function initializes a previously created RNN descriptor object .
// Between layers, not between recurrent steps.
rnnDesc
RNNDescriptor
A previously created RNN descriptor.
A previously created RNN descriptor .
hiddenSize
int
Size of the internal hidden state for each layer.
Size of the internal hidden state for each layer .
numLayers
int
Number of stacked layers.
Number of stacked layers .
dropoutDesc
DropoutDescriptor
Handle to a previously created and initialized dropout descriptor.
Dropout will be applied between layers.
Handle to a previously created and initialized dropout descriptor . Dropout will be applied between layers .
inputMode
cudnnRNNInputMode
Specifies the behavior at the input to the first layer
Specifies the behavior at the input to the first layer
direction
cudnnDirectionMode
Specifies the recurrence pattern.
Specifies the recurrence pattern .
mode
cudnnRNNMode
Specifies the type of RNN to compute.
Specifies the type of RNN to compute .
algo
cudnnRNNAlgo
Specifies which RNN algorithm should be used to compute the results.
Specifies which RNN algorithm should be used to compute the results .
dataType
cudnnDataType
None