An opaque structure holding the description of a generic n-D dataset.
상속: IDisposable
예제 #1
0
 public void SetAttnDescriptor(uint attnMode, int nHeads,
                               double smScaler, cudnnDataType dataType, cudnnDataType computePrec,
                               cudnnMathType mathType, DropoutDescriptor attnDropoutDesc,
                               DropoutDescriptor postDropoutDesc, int qSize, int kSize, int vSize,
                               int qProjSize, int kProjSize, int vProjSize, int oProjSize,
                               int qoMaxSeqLength, int kvMaxSeqLength, int maxBatchSize, int maxBeamSize)
 {
     res = CudaDNNNativeMethods.cudnnSetAttnDescriptor(_desc, attnMode, nHeads,
                                                       smScaler, dataType, computePrec,
                                                       mathType, attnDropoutDesc.Desc,
                                                       postDropoutDesc.Desc, qSize, kSize, vSize,
                                                       qProjSize, kProjSize, vProjSize, oProjSize,
                                                       qoMaxSeqLength, kvMaxSeqLength, maxBatchSize, maxBeamSize);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSetAttnDescriptor", res));
     if (res != cudnnStatus.Success)
     {
         throw new CudaDNNException(res);
     }
 }
예제 #2
0
 /// <summary>
 /// This function initializes a previously created RNN descriptor object.
 /// </summary>
 /// <param name="hiddenSize">Size of the internal hidden state for each layer.</param>
 /// <param name="seqLength">Number of iterations to unroll over.</param>
 /// <param name="numLayers">Number of layers.</param>
 /// <param name="dropoutDesc">Handle to a previously created and initialized dropout descriptor.</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">The type of RNN to compute.</param>
 /// <param name="dataType">Math precision.</param>
 public void SetRNNDescriptor(
                                                 int hiddenSize,
                                                 int seqLength,
                                                 int numLayers,
                                                 DropoutDescriptor dropoutDesc, // Between layers, not between recurrent steps.
                                                 cudnnRNNInputMode inputMode,
                                                 cudnnDirectionMode direction,
                                                 cudnnRNNMode mode,
                                                 cudnnDataType dataType)
 {
     res = CudaDNNNativeMethods.cudnnSetRNNDescriptor(_desc, hiddenSize, seqLength, numLayers, dropoutDesc.Desc, inputMode, direction, mode, dataType);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSetRNNDescriptor", res));
     if (res != cudnnStatus.Success) throw new CudaDNNException(res);
 }