Example #1
0
        public static CudnnTensorDescriptor CreateTensor(CudnnTensorDescriptorParameters parameters)
        {
            var tensor = CreateTensor();

            tensor.SetParameters(parameters);
            return(tensor);
        }
        public void SetParameters(CudnnTensorDescriptorParameters param)
        {
            if (param == null)
                throw new ArgumentNullException("param");

            CudnnContext.Invoke(() => CudnnNativeMethods.cudnnSetTensor4dDescriptorEx(
                                            this.Handle, param.Type,
                                            param.Num, param.Channels, param.Height, param.Width,
                                            param.NumStride, param.ChannelsStride, param.HeightStride, param.WidthStride));

            this.descriptorParams = param;
        }
        public void SetParameters(CudnnTensorDescriptorParameters param)
        {
            if (param == null)
            {
                throw new ArgumentNullException("param");
            }

            CudnnContext.Invoke(() => CudnnNativeMethods.cudnnSetTensor4dDescriptorEx(
                                    this.Handle, param.Type,
                                    param.Num, param.Channels, param.Height, param.Width,
                                    param.NumStride, param.ChannelsStride, param.HeightStride, param.WidthStride));

            this.descriptorParams = param;
        }
Example #4
0
 public static CudnnTensorDescriptor CreateTensor(CudnnTensorDescriptorParameters parameters)
 {
     var tensor = CreateTensor();
     tensor.SetParameters(parameters);
     return tensor;
 }