Library/ManagedCuda/CudaDNN/TensorDescriptor.cs
/// <summary>
/// This function initializes a previously created generic Tensor descriptor object into a
/// 4D tensor, similarly to cudnnSetTensor4dDescriptor but with the strides explicitly
/// passed as parameters. This can be used to lay out the 4D tensor in any order or simply to
/// define gaps between dimensions.
/// </summary>
/// <param name="dataType">Data type.</param>
/// <param name="n">Number of images.</param>
/// <param name="c">Number of feature maps per image.</param>
/// <param name="h">Height of each feature map.</param>
/// <param name="w">Width of each feature map.</param>
/// <param name="nStride">Stride between two consecutive images.</param>
/// <param name="cStride">Stride between two consecutive feature maps.</param>
/// <param name="hStride">Stride between two consecutive rows.</param>
/// <param name="wStride">Stride between two consecutive columns.</param>
This function initializes a previously created generic Tensor descriptor object into a
4D tensor, similarly to cudnnSetTensor4dDescriptor but with the strides explicitly
passed as parameters. This can be used to lay out the 4D tensor in any order or simply to
define gaps between dimensions.
This function initializes a previously created generic Tensor descriptor object into a 4D tensor similarly to cudnnSetTensor4dDescriptor but with the strides explicitly passed as parameters . This can be used to lay out the 4D tensor in any order or simply to define gaps between dimensions .
public void SetTensor4dDescriptorEx(cudnnDataType dataType, 
                                            int n,        
                                            int c,        
                                            int h,        
                                            int w,        
                                            int nStride,
                                            int cStride,
                                            int hStride,
                                            int wStride
                                            )
        {
            res = CudaDNNNativeMethods.cudnnSetTensor4dDescriptorEx(_desc, dataType, n, c, h, w, nStride, cStride, hStride, wStride);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSetTensor4dDescriptorEx", res));
            if (res != cudnnStatus.Success) throw new CudaDNNException(res);
        }
public void SetTensor4dDescriptorEx ( cudnnDataType dataType , int n , int c , int h , int w , int nStride , int cStride , int hStride , int wStride ) { res = CudaDNNNativeMethods . cudnnSetTensor4dDescriptorEx ( _desc , dataType , n , c , h , w , nStride , cStride , hStride , wStride ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != cudnnStatus . Success ) throw new CudaDNNException ( res ) ; }
This function initializes a previously created generic Tensor descriptor object into a
4D tensor, similarly to cudnnSetTensor4dDescriptor but with the strides explicitly
passed as parameters.
This function initializes a previously created generic Tensor descriptor object into a 4D tensor similarly to cudnnSetTensor4dDescriptor but with the strides explicitly passed as parameters .
// image data type // number of inputs (batch size) // number of input feature maps // height of input section // width of input section
dataType
cudnnDataType
None
n
int
Number of images.
Number of images .
c
int
Number of feature maps per image.
Number of feature maps per image .
h
int
Height of each feature map.
Height of each feature map .
w
int
Width of each feature map.
Width of each feature map .
nStride
int
Stride between two consecutive images.
Stride between two consecutive images .
cStride
int
Stride between two consecutive feature maps.
Stride between two consecutive feature maps .
hStride
int
Stride between two consecutive rows.
Stride between two consecutive rows .
wStride
int
Stride between two consecutive columns.
Stride between two consecutive columns .