ManagedCuda.CudaDNN.ConvolutionDescriptor.GetConvolution2dForwardOutputDim C# (CSharp) Method

GetConvolution2dForwardOutputDim() public method

This function returns the dimensions of the resulting 4D tensor of a 2D convolution, given the convolution descriptor, the input tensor descriptor and the filter descriptor This function can help to setup the output tensor and allocate the proper amount of memory prior to launch the actual convolution. Each dimension h and w of the output images is computed as followed: outputDim = 1 + (inputDim + 2*pad - filterDim)/convolutionStride;
public GetConvolution2dForwardOutputDim ( TensorDescriptor inputTensorDesc, FilterDescriptor filterDesc, int &n, int &c, int &h, int &w ) : void
inputTensorDesc TensorDescriptor Handle to a previously initialized tensor descriptor.
filterDesc FilterDescriptor Handle to a previously initialized filter descriptor.
n int Number of output images.
c int Number of output feature maps per image.
h int Height of each output feature map.
w int Width of each output feature map.
return void
        public void GetConvolution2dForwardOutputDim(TensorDescriptor inputTensorDesc,
													FilterDescriptor filterDesc,
													ref int n,
													ref int c,
													ref int h,
													ref int w
												)
        {
            res = CudaDNNNativeMethods.cudnnGetConvolution2dForwardOutputDim(_desc, inputTensorDesc.Desc, filterDesc.Desc, ref n, ref c, ref h, ref w);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnGetConvolution2dForwardOutputDim", res));
            if (res != cudnnStatus.Success) throw new CudaDNNException(res);
        }