Library/ManagedCuda/CudaDNN/TensorDescriptor.cs
/// <summary>
/// This function initializes a previously created generic Tensor descriptor object into a
/// 4D tensor. The strides of the four dimensions are inferred from the format parameter
/// and set in such a way that the data is contiguous in memory with no padding between
/// dimensions.
/// </summary>
/// <param name="format">Type of format.</param>
/// <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>
This function initializes a previously created generic Tensor descriptor object into a
4D tensor. The strides of the four dimensions are inferred from the format parameter
and set in such a way that the data is contiguous in memory with no padding between
dimensions.
This function initializes a previously created generic Tensor descriptor object into a 4D tensor . The strides of the four dimensions are inferred from the format parameter and set in such a way that the data is contiguous in memory with no padding between dimensions .
public void SetTensor4dDescriptor(cudnnTensorFormat format,
                                            cudnnDataType dataType, 
                                            int n,        
                                            int c,        
                                            int h,        
                                            int w         
                                        )
        {
            res = CudaDNNNativeMethods.cudnnSetTensor4dDescriptor(_desc, format, dataType, n, c, h, w);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSetTensor4dDescriptor", res));
            if (res != cudnnStatus.Success) throw new CudaDNNException(res);
        }
public void SetTensor4dDescriptor ( cudnnTensorFormat format , cudnnDataType dataType , int n , int c , int h , int w ) { res = CudaDNNNativeMethods . cudnnSetTensor4dDescriptor ( _desc , format , dataType , n , c , h , w ) ; 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.
This function initializes a previously created generic Tensor descriptor object into a 4D tensor .
// image data type // number of inputs (batch size) // number of input feature maps // height of input section // width of input section
format
cudnnTensorFormat
Type of format.
Type of format .
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 .