private cudnnSetConvolution2dDescriptor ( |
||
convDesc | ||
pad_h | int | |
pad_w | int | |
u | int | |
v | int | |
upscalex | int | |
upscaley | int | |
mode | cudnnConvolutionMode | |
dataType | cudnnDataType | |
return | cudnnStatus |
public void SetConvolution2dDescriptor(int pad_h, // zero-padding height int pad_w, // zero-padding width int u, // vertical filter stride int v, // horizontal filter stride int upscalex, // upscale the input in x-direction int upscaley, // upscale the input in y-direction cudnnConvolutionMode mode ) { res = CudaDNNNativeMethods.cudnnSetConvolution2dDescriptor(_desc, pad_h, pad_w, u, v, upscalex, upscaley, mode); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSetConvolution2dDescriptor", res)); if (res != cudnnStatus.Success) { throw new CudaDNNException(res); } }
/// <summary> /// This function initializes a previously created convolution descriptor object into a 2D /// correlation. This function assumes that the tensor and filter descriptors corresponds /// to the formard convolution path and checks if their settings are valid. That same /// convolution descriptor can be reused in the backward path provided it corresponds to /// the same layer. /// </summary> /// <param name="pad_h">zero-padding height: number of rows of zeros implicitly concatenated /// onto the top and onto the bottom of input images.</param> /// <param name="pad_w">zero-padding width: number of columns of zeros implicitly concatenated /// onto the left and onto the right of input images.</param> /// <param name="u">Vertical filter stride.</param> /// <param name="v">Horizontal filter stride.</param> /// <param name="dilation_h">Filter height dilation.</param> /// <param name="dilation_w">Filter width dilation.</param> /// <param name="mode">Selects between CUDNN_CONVOLUTION and CUDNN_CROSS_CORRELATION.</param> /// <param name="dataType">Selects the datatype in which the computation will be done.</param> public void SetConvolution2dDescriptor(int pad_h, // zero-padding height int pad_w, // zero-padding width int u, // vertical filter stride int v, // horizontal filter stride int dilation_h, // filter dilation in the vertical dimension int dilation_w, // filter dilation in the horizontal dimension cudnnConvolutionMode mode, cudnnDataType dataType ) { res = CudaDNNNativeMethods.cudnnSetConvolution2dDescriptor(_desc, pad_h, pad_w, u, v, dilation_h, dilation_w, mode, dataType); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSetConvolution2dDescriptor", res)); if (res != cudnnStatus.Success) { throw new CudaDNNException(res); } }