Documentation
¶
Index ¶
- Constants
- type Activation
- type ActivationMode
- type Algorithm
- type AlgorithmDescriptor
- type AlgorithmPerformance
- func (a *AlgorithmPerformance) AlgoDesc() *AlgorithmDescriptor
- func (a *AlgorithmPerformance) C() C.cudnnAlgorithmPerformance_t
- func (a *AlgorithmPerformance) Memory() uintptr
- func (a *AlgorithmPerformance) N() int
- func (a *AlgorithmPerformance) Status() Status
- func (a *AlgorithmPerformance) Time() float32
- type Attention
- func (a *Attention) AttnDropoutDesc() *Dropout
- func (a *Attention) AttnMode() uint
- func (a *Attention) C() C.cudnnAttnDescriptor_t
- func (a *Attention) ComputePrec() DataType
- func (a *Attention) DataType() DataType
- func (a *Attention) KProjSize() int
- func (a *Attention) KSize() int
- func (a *Attention) KvMaxSeqLength() int
- func (a *Attention) MathType() MathType
- func (a *Attention) MaxBatchSize() int
- func (a *Attention) MaxBeamSize() int
- func (a *Attention) NHeads() int
- func (a *Attention) OProjSize() int
- func (a *Attention) PostDropoutDesc() *Dropout
- func (a *Attention) QProjSize() int
- func (a *Attention) QSize() int
- func (a *Attention) QoMaxSeqLength() int
- func (a *Attention) SmScaler() float64
- func (a *Attention) VProjSize() int
- func (a *Attention) VSize() int
- type Backend
- type BackendAttributeName
- type BackendAttributeType
- type BackendDescriptorType
- type BackendHeurMode
- type BackendKnobType
- type BackendLayoutType
- type BackendNumericalNote
- type BatchNormMode
- type BatchNormOps
- type CTCLoss
- type CTCLossAlgo
- type Context
- func (co *Context) ActivationBackward(activationDesc *Activation, alpha float64, yDesc *TensorDescriptor, y Memory, ...) error
- func (co *Context) ActivationForward(activationDesc *Activation, alpha float64, xDesc *TensorDescriptor, x Memory, ...) error
- func (co *Context) AddTensor(alpha float64, aDesc *TensorDescriptor, A Memory, beta float64, ...) error
- func (co *Context) BatchNormalizationBackward(mode BatchNormMode, alphaDataDiff float64, betaDataDiff float64, ...) error
- func (co *Context) BatchNormalizationForwardInference(mode BatchNormMode, alpha float64, beta float64, xDesc *TensorDescriptor, ...) error
- func (co *Context) BatchNormalizationForwardTraining(mode BatchNormMode, alpha float64, beta float64, xDesc *TensorDescriptor, ...) error
- func (ctx *Context) Close() error
- func (co *Context) ConvolutionBackwardBias(alpha float64, dyDesc *TensorDescriptor, dy Memory, beta float64, ...) error
- func (co *Context) ConvolutionBackwardData(alpha float64, wDesc *Filter, w Memory, dyDesc *TensorDescriptor, dy Memory, ...) error
- func (co *Context) ConvolutionBackwardFilter(alpha float64, xDesc *TensorDescriptor, x Memory, dyDesc *TensorDescriptor, ...) error
- func (co *Context) ConvolutionBiasActivationForward(alpha1 float64, xDesc *TensorDescriptor, x Memory, wDesc *Filter, w Memory, ...) error
- func (co *Context) ConvolutionForward(alpha float64, xDesc *TensorDescriptor, x Memory, wDesc *Filter, w Memory, ...) error
- func (co *Context) DivisiveNormalizationBackward(normDesc *LRN, mode DivNormMode, alpha float64, xDesc *TensorDescriptor, ...) error
- func (co *Context) DivisiveNormalizationForward(normDesc *LRN, mode DivNormMode, alpha float64, xDesc *TensorDescriptor, ...) error
- func (ctx *Context) DoOp(op *Op, alpha1 float64, aDesc *TensorDescriptor, aData Memory, alpha2 float64, ...) error
- func (co *Context) DropoutBackward(dropoutDesc *Dropout, dydesc *TensorDescriptor, dy Memory, ...) error
- func (co *Context) DropoutForward(dropoutDesc *Dropout, xdesc *TensorDescriptor, x Memory, ...) error
- func (co *Context) DropoutGetStatesSize() (sizeInBytes uintptr, err error)
- func (co *Context) FindConvolutionBackwardDataAlgorithm(wDesc *Filter, dyDesc *TensorDescriptor, convDesc *Convolution, ...) (returnedAlgoCount int, perfResults *ConvolutionBwdDataPerf, err error)
- func (co *Context) FindConvolutionBackwardDataAlgorithmEx(wDesc *Filter, w Memory, dyDesc *TensorDescriptor, dy Memory, ...) (returnedAlgoCount int, perfResults *ConvolutionBwdDataPerf, err error)
- func (co *Context) FindConvolutionBackwardFilterAlgorithm(xDesc *TensorDescriptor, dyDesc *TensorDescriptor, convDesc *Convolution, ...) (returnedAlgoCount int, perfResults *ConvolutionBwdPerf, err error)
- func (co *Context) FindConvolutionBackwardFilterAlgorithmEx(xDesc *TensorDescriptor, x Memory, dyDesc *TensorDescriptor, y Memory, ...) (returnedAlgoCount int, perfResults *ConvolutionBwdPerf, err error)
- func (co *Context) FindConvolutionForwardAlgorithm(xDesc *TensorDescriptor, wDesc *Filter, convDesc *Convolution, ...) (returnedAlgoCount int, perfResults *ConvolutionFwdPerf, err error)
- func (co *Context) FindConvolutionForwardAlgorithmEx(xDesc *TensorDescriptor, x Memory, wDesc *Filter, w Memory, ...) (returnedAlgoCount int, perfResults *ConvolutionFwdPerf, err error)
- func (co *Context) GetReductionIndicesSize(reduceTensorDesc *Reduction, aDesc *TensorDescriptor, cDesc *TensorDescriptor) (sizeInBytes uintptr, err error)
- func (co *Context) GetReductionWorkspaceSize(reduceTensorDesc *Reduction, aDesc *TensorDescriptor, cDesc *TensorDescriptor) (sizeInBytes uintptr, err error)
- func (co *Context) Im2Col(xDesc *TensorDescriptor, x Memory, wDesc *Filter, convDesc *Convolution, ...) error
- func (co *Context) LRNCrossChannelBackward(normDesc *LRN, lrnMode LRNMode, alpha float64, yDesc *TensorDescriptor, ...) (dxDesc *TensorDescriptor, err error)
- func (co *Context) LRNCrossChannelForward(normDesc *LRN, lrnMode LRNMode, alpha float64, xDesc *TensorDescriptor, ...) error
- func (co *Context) OpTensor(opTensorDesc *Op, alpha1 float64, aDesc *TensorDescriptor, A Memory, ...) error
- func (co *Context) PoolingBackward(poolingDesc *Pooling, alpha float64, yDesc *TensorDescriptor, y Memory, ...) error
- func (co *Context) PoolingForward(poolingDesc *Pooling, alpha float64, xDesc *TensorDescriptor, x Memory, ...) error
- func (co *Context) ReduceTensor(reduceTensorDesc *Reduction, indices Memory, indicesSizeInBytes uintptr, ...) error
- func (co *Context) ScaleTensor(yDesc *TensorDescriptor, y Memory, alpha float64) error
- func (co *Context) SoftmaxBackward(algo SoftmaxAlgorithm, mode SoftmaxMode, alpha float64, ...) error
- func (co *Context) SoftmaxForward(algo SoftmaxAlgorithm, mode SoftmaxMode, alpha float64, ...) error
- func (co *Context) SpatialTfGridGeneratorBackward(stDesc *SpatialTransformer, dgrid Memory, dtheta Memory) error
- func (co *Context) SpatialTfGridGeneratorForward(stDesc *SpatialTransformer, theta Memory, grid Memory) error
- func (co *Context) SpatialTfSamplerBackward(stDesc *SpatialTransformer, alpha float64, xDesc *TensorDescriptor, x Memory, ...) error
- func (co *Context) SpatialTfSamplerForward(stDesc *SpatialTransformer, alpha float64, xDesc *TensorDescriptor, x Memory, ...) error
- func (co *Context) TransformTensor(alpha float64, xDesc *TensorDescriptor, x Memory, beta float64, ...) error
- type Convolution
- func (c *Convolution) CalcForwardOutputShape(input *TensorDescriptor, filter *Filter, dims int) (retVal []int, err error)
- func (c *Convolution) Dilation() []int
- func (c *Convolution) FilterStride() []int
- func (c *Convolution) ForwardOutputShape(input *TensorDescriptor, filter *Filter, dims int) (retVal []int, err error)
- func (c *Convolution) GroupCount() int
- func (c *Convolution) MathType() MathType
- func (c *Convolution) Padding() []int
- type ConvolutionBwdDataAlgo
- type ConvolutionBwdDataPerf
- type ConvolutionBwdFilterAlgo
- type ConvolutionBwdPerf
- type ConvolutionFwdAlgo
- type ConvolutionFwdPerf
- type ConvolutionMode
- type ConvolutionPreference
- type ConvolutionType
- type DataType
- type Determinism
- type DirectionMode
- type DivNormMode
- type Dropout
- func (dr *Dropout) Dropout() float32
- func (dr *Dropout) Handle() *Context
- func (dr *Dropout) IsReady() bool
- func (dr *Dropout) RequiredStateSize(ctx *Context) (uintptr, error)
- func (dr *Dropout) Reset()
- func (dr *Dropout) RestoreDropoutDescriptor(handle *Context, dropout float32, states Memory, stateSizeInBytes uintptr, ...) error
- func (dr *Dropout) Seed() uint64
- func (dr *Dropout) StateSizeInBytes() uintptr
- func (dr *Dropout) States() Memory
- func (dr *Dropout) Use(ctx *Context, states Memory, stateSizeInBytes uintptr, seed uint64) error
- type ErrQueryMode
- type Filter
- type FoldingDirection
- type ForwardMode
- type FusedOpConsts
- type FusedOpVariantParams
- type FusedOps
- type FusedOpsConstParamLabel
- type FusedOpsPointerPlaceHolder
- type FusedOpsVariantParamLabel
- type GenStatsMode
- type IndicesType
- type LRN
- type LRNMode
- type LossNormalizationMode
- type MathType
- type Memory
- type MultiHeadAttnWeightKind
- type NanPropagation
- type NormAlgo
- type NormMode
- type NormOps
- type Op
- type OpTensorOp
- type PointwiseMode
- type Pooling
- func (p *Pooling) CalcOutputShape(input *TensorDescriptor, dims int) (retVal []int, err error)
- func (p *Pooling) Mode() PoolingMode
- func (p *Pooling) NaNPropagation() NanPropagation
- func (p *Pooling) OutputShape(input *TensorDescriptor, dims int) (retVal []int, err error)
- func (p *Pooling) Padding() []int
- func (p *Pooling) Shape() []int
- func (p *Pooling) Strides() []int
- type PoolingMode
- type RNN
- func (r *RNN) Algo() RNNAlgo
- func (r *RNN) DataType() DataType
- func (r *RNN) DirectionMode() DirectionMode
- func (r *RNN) Dropout() *Dropout
- func (r *RNN) HiddenSize() int
- func (r *RNN) InputMode() RNNInputMode
- func (r *RNN) MatrixMathType() MathType
- func (r *RNN) Mode() RNNMode
- func (r *RNN) NumLayers() int
- func (r *RNN) SetMatrixMathType(mathType MathType) error
- type RNNAlgo
- type RNNBiasMode
- type RNNClipMode
- type RNNData
- func (r *RNNData) BatchSize() int
- func (r *RNNData) C() C.cudnnRNNDataDescriptor_t
- func (r *RNNData) DataType() DataType
- func (r *RNNData) Layout() RNNDataLayout
- func (r *RNNData) MaxSeqLength() int
- func (r *RNNData) PaddingFill() Memory
- func (r *RNNData) SeqLengthArray() []int
- func (r *RNNData) VectorSize() int
- type RNNDataLayout
- type RNNInputMode
- type RNNMode
- type RNNPlan
- type ReduceTensorIndices
- type ReduceTensorOp
- type Reduction
- func (r *Reduction) C() C.cudnnReduceTensorDescriptor_t
- func (r *Reduction) ReduceTensorCompType() DataType
- func (r *Reduction) ReduceTensorIndices() ReduceTensorIndices
- func (r *Reduction) ReduceTensorIndicesType() IndicesType
- func (r *Reduction) ReduceTensorNanOpt() NanPropagation
- func (r *Reduction) ReduceTensorOp() ReduceTensorOp
- type ReorderType
- type SamplerType
- type SeqData
- func (s *SeqData) Axes() []SeqDataAxis
- func (s *SeqData) C() C.cudnnSeqDataDescriptor_t
- func (s *SeqData) DataType() DataType
- func (s *SeqData) DimA() []int
- func (s *SeqData) NbDims() int
- func (s *SeqData) PaddingFill() Memory
- func (s *SeqData) SeqLengthArray() []int
- func (s *SeqData) SeqLengthArraySize() uintptr
- type SeqDataAxis
- type Severity
- type SoftmaxAlgorithm
- type SoftmaxMode
- type SpatialTransformer
- type Status
- type TensorDescriptor
- func (t *TensorDescriptor) DataType() DataType
- func (te *TensorDescriptor) DeriveBNTensorDescriptor(xDesc *TensorDescriptor, mode BatchNormMode) (derivedBnDesc *TensorDescriptor, err error)
- func (te *TensorDescriptor) DropoutGetReserveSpaceSize() (sizeInBytes uintptr, err error)
- func (t *TensorDescriptor) Format() TensorFormat
- func (t *TensorDescriptor) Shape() []int
- func (t *TensorDescriptor) Strides() []int
- type TensorFormat
- type TensorTransform
- func (t *TensorTransform) C() C.cudnnTensorTransformDescriptor_t
- func (t *TensorTransform) DestFormat() TensorFormat
- func (t *TensorTransform) Direction() FoldingDirection
- func (t *TensorTransform) FoldA() []uint32
- func (t *TensorTransform) NDims() uint32
- func (t *TensorTransform) PadAfterA() []int32
- func (t *TensorTransform) PadBeforeA() []int32
- type WgradMode
- Bugs
Constants ¶
const ( Fwd ConvolutionType = 0 // combination of these indicate are used for bwd functions BwdFilter = 1 << 7 BwdData = 1<<7 | 1<<6 )
const ( Success cudnnStatus = C.CUDNN_STATUS_SUCCESS NotInitialized cudnnStatus = C.CUDNN_STATUS_NOT_INITIALIZED AllocFailed cudnnStatus = C.CUDNN_STATUS_ALLOC_FAILED BadParam cudnnStatus = C.CUDNN_STATUS_BAD_PARAM InternalError cudnnStatus = C.CUDNN_STATUS_INTERNAL_ERROR InvalidValue cudnnStatus = C.CUDNN_STATUS_INVALID_VALUE ArchMismatch cudnnStatus = C.CUDNN_STATUS_ARCH_MISMATCH MappingError cudnnStatus = C.CUDNN_STATUS_MAPPING_ERROR ExecutionFailed cudnnStatus = C.CUDNN_STATUS_EXECUTION_FAILED NotSupported cudnnStatus = C.CUDNN_STATUS_NOT_SUPPORTED LicenseError cudnnStatus = C.CUDNN_STATUS_LICENSE_ERROR RuntimePrerequisiteMissing cudnnStatus = C.CUDNN_STATUS_RUNTIME_PREREQUISITE_MISSING RuntimeInProgress cudnnStatus = C.CUDNN_STATUS_RUNTIME_IN_PROGRESS RuntimeFpOverflow cudnnStatus = C.CUDNN_STATUS_RUNTIME_FP_OVERFLOW )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Activation ¶
type Activation struct {
// contains filtered or unexported fields
}
Activation is a representation of cudnnActivationDescriptor_t.
func NewActivation ¶
func NewActivation(mode ActivationMode, reluNanOpt NanPropagation, coef float64) (retVal *Activation, err error)
NewActivation creates a new Activation.
func (*Activation) C ¶ added in v0.9.4
func (a *Activation) C() C.cudnnActivationDescriptor_t
C returns the cgo representation.
func (*Activation) Mode ¶
func (a *Activation) Mode() ActivationMode
Mode returns the internal mode.
func (*Activation) ReluNanOpt ¶
func (a *Activation) ReluNanOpt() NanPropagation
ReluNanOpt returns the internal reluNanOpt.
type ActivationMode ¶
type ActivationMode int
const ( Sigmoid ActivationMode = C.CUDNN_ACTIVATION_SIGMOID ReLU ActivationMode = C.CUDNN_ACTIVATION_RELU Tanh ActivationMode = C.CUDNN_ACTIVATION_TANH ClippedReLU ActivationMode = C.CUDNN_ACTIVATION_CLIPPED_RELU Elu ActivationMode = C.CUDNN_ACTIVATION_ELU Identity ActivationMode = C.CUDNN_ACTIVATION_IDENTITY )
func (ActivationMode) C ¶
func (e ActivationMode) C() C.cudnnActivationMode_t
C returns the C representation of ActivationMode
func (ActivationMode) String ¶
func (e ActivationMode) String() string
type AlgorithmDescriptor ¶ added in v0.9.4
type AlgorithmDescriptor struct {
// contains filtered or unexported fields
}
AlgorithmDescriptor is a representation of cudnnAlgorithmDescriptor_t.
func NewAlgorithmDescriptor ¶ added in v0.9.4
func NewAlgorithmDescriptor(algorithm Algorithm) (retVal *AlgorithmDescriptor, err error)
NewAlgorithmDescriptor creates a new AlgorithmDescriptor.
func (*AlgorithmDescriptor) C ¶ added in v0.9.4
func (a *AlgorithmDescriptor) C() C.cudnnAlgorithmDescriptor_t
C returns the internal cgo representation
type AlgorithmPerformance ¶ added in v0.9.4
type AlgorithmPerformance struct {
// contains filtered or unexported fields
}
AlgorithmPerformance is a representation of cudnnAlgorithmPerformance_t.
func NewAlgorithmPerformance ¶ added in v0.9.4
func NewAlgorithmPerformance(algoDesc *AlgorithmDescriptor, n int, status Status, time float32, memory uintptr) (retVal *AlgorithmPerformance, err error)
NewAlgorithmPerformance creates `n` new cudnnAlgorithmPerformance objects, wrapped in AlgorithmPerformance.
func (*AlgorithmPerformance) AlgoDesc ¶ added in v0.9.4
func (a *AlgorithmPerformance) AlgoDesc() *AlgorithmDescriptor
AlgoDesc returns the internal algoDesc.
func (*AlgorithmPerformance) C ¶ added in v0.9.4
func (a *AlgorithmPerformance) C() C.cudnnAlgorithmPerformance_t
C returns the cgo representation.
func (*AlgorithmPerformance) Memory ¶ added in v0.9.4
func (a *AlgorithmPerformance) Memory() uintptr
Memory returns the internal memory.
func (*AlgorithmPerformance) N ¶ added in v0.9.4
func (a *AlgorithmPerformance) N() int
N returns how many algorithm performance objects were created in the graphics card.
func (*AlgorithmPerformance) Status ¶ added in v0.9.4
func (a *AlgorithmPerformance) Status() Status
Status returns the internal status.
func (*AlgorithmPerformance) Time ¶ added in v0.9.4
func (a *AlgorithmPerformance) Time() float32
Time returns the internal time.
type Attention ¶ added in v0.9.4
type Attention struct {
// contains filtered or unexported fields
}
Attention is a representation of cudnnAttnDescriptor_t.
func NewAttention ¶ added in v0.9.4
func NewAttention(attnMode uint, nHeads int, smScaler float64, dataType DataType, computePrec DataType, mathType MathType, attnDropoutDesc *Dropout, postDropoutDesc *Dropout, qSize int, kSize int, vSize int, qProjSize int, kProjSize int, vProjSize int, oProjSize int, qoMaxSeqLength int, kvMaxSeqLength int, maxBatchSize int, maxBeamSize int) (retVal *Attention, err error)
NewAttention creates a new Attention.
func (*Attention) AttnDropoutDesc ¶ added in v0.9.4
AttnDropoutDesc returns the internal attnDropoutDesc.
func (*Attention) C ¶ added in v0.9.4
func (a *Attention) C() C.cudnnAttnDescriptor_t
C returns the internal cgo representation.
func (*Attention) ComputePrec ¶ added in v0.9.4
ComputePrec returns the internal computePrec.
func (*Attention) KvMaxSeqLength ¶ added in v0.9.4
KvMaxSeqLength returns the internal kvMaxSeqLength.
func (*Attention) MaxBatchSize ¶ added in v0.9.4
MaxBatchSize returns the internal maxBatchSize.
func (*Attention) MaxBeamSize ¶ added in v0.9.4
MaxBeamSize returns the internal maxBeamSize.
func (*Attention) PostDropoutDesc ¶ added in v0.9.4
PostDropoutDesc returns the internal postDropoutDesc.
func (*Attention) QoMaxSeqLength ¶ added in v0.9.4
QoMaxSeqLength returns the internal qoMaxSeqLength.
type Backend ¶ added in v0.9.4
type Backend struct {
// contains filtered or unexported fields
}
Backend is a representation of cudnnBackendDescriptor_t.
func NewBackend ¶ added in v0.9.4
func NewBackend(attributeName BackendAttributeName, attributeType BackendAttributeType, backendType BackendDescriptorType, elementCount int64, arrayOfElements Memory) (retVal *Backend, err error)
NewBackend creates a new Backend.
func (*Backend) ArrayOfElements ¶ added in v0.9.4
ArrayOfElements returns the internal arrayOfElements.
func (*Backend) AttributeName ¶ added in v0.9.4
func (b *Backend) AttributeName() BackendAttributeName
AttributeName returns the internal attributeName.
func (*Backend) AttributeType ¶ added in v0.9.4
func (b *Backend) AttributeType() BackendAttributeType
AttributeType returns the internal attributeType.
func (*Backend) C ¶ added in v0.9.4
func (b *Backend) C() C.cudnnBackendDescriptor_t
C() returns the internal cgo representation
func (*Backend) ElementCount ¶ added in v0.9.4
ElementCount returns the internal elementCount parameter.
func (*Backend) Type ¶ added in v0.9.4
func (b *Backend) Type() BackendDescriptorType
Type returns the backend type.
type BackendAttributeName ¶ added in v0.9.4
type BackendAttributeName int
const ( BEAttrNamePointwiseMode BackendAttributeName = C.CUDNN_ATTR_POINTWISE_MODE BEAttrNamePointwiseMathPrec BackendAttributeName = C.CUDNN_ATTR_POINTWISE_MATH_PREC BEAttrNamePointwiseNanPropagation BackendAttributeName = C.CUDNN_ATTR_POINTWISE_NAN_PROPAGATION BEAttrNamePointwiseReluLowerClip BackendAttributeName = C.CUDNN_ATTR_POINTWISE_RELU_LOWER_CLIP BEAttrNamePointwiseReluUpperClip BackendAttributeName = C.CUDNN_ATTR_POINTWISE_RELU_UPPER_CLIP BEAttrNameConvolutionCompType BackendAttributeName = C.CUDNN_ATTR_CONVOLUTION_COMP_TYPE BEAttrNameConvolutionConvMode BackendAttributeName = C.CUDNN_ATTR_CONVOLUTION_CONV_MODE BEAttrNameConvolutionDilations BackendAttributeName = C.CUDNN_ATTR_CONVOLUTION_DILATIONS BEAttrNameConvolutionFilterStrides BackendAttributeName = C.CUDNN_ATTR_CONVOLUTION_FILTER_STRIDES BEAttrNameConvolutionPostPaddings BackendAttributeName = C.CUDNN_ATTR_CONVOLUTION_POST_PADDINGS BEAttrNameConvolutionPrePaddings BackendAttributeName = C.CUDNN_ATTR_CONVOLUTION_PRE_PADDINGS BEAttrNameConvolutionSpatialDims BackendAttributeName = C.CUDNN_ATTR_CONVOLUTION_SPATIAL_DIMS BEAttrNameEngineheurMode BackendAttributeName = C.CUDNN_ATTR_ENGINEHEUR_MODE BEAttrNameEngineheurOperationGraph BackendAttributeName = C.CUDNN_ATTR_ENGINEHEUR_OPERATION_GRAPH BEAttrNameEngineheurResults BackendAttributeName = C.CUDNN_ATTR_ENGINEHEUR_RESULTS BEAttrNameEnginecfgEngine BackendAttributeName = C.CUDNN_ATTR_ENGINECFG_ENGINE BEAttrNameEnginecfgIntermediateInfo BackendAttributeName = C.CUDNN_ATTR_ENGINECFG_INTERMEDIATE_INFO BEAttrNameEnginecfgKnobChoices BackendAttributeName = C.CUDNN_ATTR_ENGINECFG_KNOB_CHOICES BEAttrNameExecutionPlanHandle BackendAttributeName = C.CUDNN_ATTR_EXECUTION_PLAN_HANDLE BEAttrNameExecutionPlanEngineConfig BackendAttributeName = C.CUDNN_ATTR_EXECUTION_PLAN_ENGINE_CONFIG BEAttrNameExecutionPlanWorkspaceSize BackendAttributeName = C.CUDNN_ATTR_EXECUTION_PLAN_WORKSPACE_SIZE BEAttrNameExecutionPlanComputedIntermediateUids BackendAttributeName = C.CUDNN_ATTR_EXECUTION_PLAN_COMPUTED_INTERMEDIATE_UIDS BEAttrNameExecutionPlanRunOnlyIntermediateUids BackendAttributeName = C.CUDNN_ATTR_EXECUTION_PLAN_RUN_ONLY_INTERMEDIATE_UIDS BEAttrNameIntermediateInfoUniqueId BackendAttributeName = C.CUDNN_ATTR_INTERMEDIATE_INFO_UNIQUE_ID BEAttrNameIntermediateInfoSize BackendAttributeName = C.CUDNN_ATTR_INTERMEDIATE_INFO_SIZE BEAttrNameIntermediateInfoDependentDataUids BackendAttributeName = C.CUDNN_ATTR_INTERMEDIATE_INFO_DEPENDENT_DATA_UIDS BEAttrNameIntermediateInfoDependentAttributes BackendAttributeName = C.CUDNN_ATTR_INTERMEDIATE_INFO_DEPENDENT_ATTRIBUTES BEAttrNameKnobChoiceKnobType BackendAttributeName = C.CUDNN_ATTR_KNOB_CHOICE_KNOB_TYPE BEAttrNameKnobChoiceKnobValue BackendAttributeName = C.CUDNN_ATTR_KNOB_CHOICE_KNOB_VALUE BEAttrNameOperationConvolutionForwardAlpha BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_ALPHA BEAttrNameOperationConvolutionForwardBeta BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_BETA BEAttrNameOperationConvolutionForwardConvDesc BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_CONV_DESC BEAttrNameOperationConvolutionForwardW BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_W BEAttrNameOperationConvolutionForwardX BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_X BEAttrNameOperationConvolutionForwardY BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_Y BEAttrNameOperationConvolutionBwdDataAlpha BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_ALPHA BEAttrNameOperationConvolutionBwdDataBeta BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_BETA BEAttrNameOperationConvolutionBwdDataConvDesc BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_CONV_DESC BEAttrNameOperationConvolutionBwdDataW BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_W BEAttrNameOperationConvolutionBwdDataDx BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_DX BEAttrNameOperationConvolutionBwdDataDy BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_DY BEAttrNameOperationConvolutionBwdFilterAlpha BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_ALPHA BEAttrNameOperationConvolutionBwdFilterBeta BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_BETA BEAttrNameOperationConvolutionBwdFilterConvDesc BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_CONV_DESC BEAttrNameOperationConvolutionBwdFilterDw BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_DW BEAttrNameOperationConvolutionBwdFilterX BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_X BEAttrNameOperationConvolutionBwdFilterDy BackendAttributeName = C.CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_DY BEAttrNameOperationPointwisePwDescriptor BackendAttributeName = C.CUDNN_ATTR_OPERATION_POINTWISE_PW_DESCRIPTOR BEAttrNameOperationPointwiseXdesc BackendAttributeName = C.CUDNN_ATTR_OPERATION_POINTWISE_XDESC BEAttrNameOperationPointwiseBdesc BackendAttributeName = C.CUDNN_ATTR_OPERATION_POINTWISE_BDESC BEAttrNameOperationPointwiseYdesc BackendAttributeName = C.CUDNN_ATTR_OPERATION_POINTWISE_YDESC BEAttrNameOperationPointwiseAlpha1 BackendAttributeName = C.CUDNN_ATTR_OPERATION_POINTWISE_ALPHA1 BEAttrNameOperationPointwiseAlpha2 BackendAttributeName = C.CUDNN_ATTR_OPERATION_POINTWISE_ALPHA2 BEAttrNameOperationGenstatsMode BackendAttributeName = C.CUDNN_ATTR_OPERATION_GENSTATS_MODE BEAttrNameOperationGenstatsMathPrec BackendAttributeName = C.CUDNN_ATTR_OPERATION_GENSTATS_MATH_PREC BEAttrNameOperationGenstatsXdesc BackendAttributeName = C.CUDNN_ATTR_OPERATION_GENSTATS_XDESC BEAttrNameOperationGenstatsSumdesc BackendAttributeName = C.CUDNN_ATTR_OPERATION_GENSTATS_SUMDESC BEAttrNameOperationGenstatsSqsumdesc BackendAttributeName = C.CUDNN_ATTR_OPERATION_GENSTATS_SQSUMDESC BEAttrNameOperationgraphHandle BackendAttributeName = C.CUDNN_ATTR_OPERATIONGRAPH_HANDLE BEAttrNameOperationgraphOps BackendAttributeName = C.CUDNN_ATTR_OPERATIONGRAPH_OPS BEAttrNameOperationgraphEngineGlobalCount BackendAttributeName = C.CUDNN_ATTR_OPERATIONGRAPH_ENGINE_GLOBAL_COUNT BEAttrNameTensorByteAlignment BackendAttributeName = C.CUDNN_ATTR_TENSOR_BYTE_ALIGNMENT BEAttrNameTensorDataType BackendAttributeName = C.CUDNN_ATTR_TENSOR_DATA_TYPE BEAttrNameTensorDimensions BackendAttributeName = C.CUDNN_ATTR_TENSOR_DIMENSIONS BEAttrNameTensorStrides BackendAttributeName = C.CUDNN_ATTR_TENSOR_STRIDES BEAttrNameTensorVectorCount BackendAttributeName = C.CUDNN_ATTR_TENSOR_VECTOR_COUNT BEAttrNameTensorVectorizedDimension BackendAttributeName = C.CUDNN_ATTR_TENSOR_VECTORIZED_DIMENSION BEAttrNameTensorUniqueId BackendAttributeName = C.CUDNN_ATTR_TENSOR_UNIQUE_ID BEAttrNameTensorIsVirtual BackendAttributeName = C.CUDNN_ATTR_TENSOR_IS_VIRTUAL BEAttrNameVariantPackUniqueIds BackendAttributeName = C.CUDNN_ATTR_VARIANT_PACK_UNIQUE_IDS BEAttrNameVariantPackDataPointers BackendAttributeName = C.CUDNN_ATTR_VARIANT_PACK_DATA_POINTERS BEAttrNameVariantPackIntermediates BackendAttributeName = C.CUDNN_ATTR_VARIANT_PACK_INTERMEDIATES BEAttrNameVariantPackWorkspace BackendAttributeName = C.CUDNN_ATTR_VARIANT_PACK_WORKSPACE BEAttrNameLayoutInfoTensorUid BackendAttributeName = C.CUDNN_ATTR_LAYOUT_INFO_TENSOR_UID BEAttrNameLayoutInfoTypes BackendAttributeName = C.CUDNN_ATTR_LAYOUT_INFO_TYPES BEAttrNameKnobInfoType BackendAttributeName = C.CUDNN_ATTR_KNOB_INFO_TYPE BEAttrNameKnobInfoMaximumValue BackendAttributeName = C.CUDNN_ATTR_KNOB_INFO_MAXIMUM_VALUE BEAttrNameKnobInfoMinimumValue BackendAttributeName = C.CUDNN_ATTR_KNOB_INFO_MINIMUM_VALUE BEAttrNameKnobInfoStride BackendAttributeName = C.CUDNN_ATTR_KNOB_INFO_STRIDE BEAttrNameEngineOperationGraph BackendAttributeName = C.CUDNN_ATTR_ENGINE_OPERATION_GRAPH BEAttrNameEngineGlobalIndex BackendAttributeName = C.CUDNN_ATTR_ENGINE_GLOBAL_INDEX BEAttrNameEngineKnobInfo BackendAttributeName = C.CUDNN_ATTR_ENGINE_KNOB_INFO BEAttrNameEngineNumericalNote BackendAttributeName = C.CUDNN_ATTR_ENGINE_NUMERICAL_NOTE BEAttrNameEngineLayoutInfo BackendAttributeName = C.CUDNN_ATTR_ENGINE_LAYOUT_INFO )
func (BackendAttributeName) C ¶ added in v0.9.4
func (e BackendAttributeName) C() C.cudnnBackendAttributeName_t
C returns the C representation of BackendAttributeName
func (BackendAttributeName) String ¶ added in v0.9.4
func (e BackendAttributeName) String() string
type BackendAttributeType ¶ added in v0.9.4
type BackendAttributeType int
const ( BEAttrHandle BackendAttributeType = C.CUDNN_TYPE_HANDLE BEAttrDataType BackendAttributeType = C.CUDNN_TYPE_DATA_TYPE BEAttrBoolean BackendAttributeType = C.CUDNN_TYPE_BOOLEAN BEAttrInt64 BackendAttributeType = C.CUDNN_TYPE_INT64 BEAttrFloat BackendAttributeType = C.CUDNN_TYPE_FLOAT BEAttrDouble BackendAttributeType = C.CUDNN_TYPE_DOUBLE BEAttrVoidPtr BackendAttributeType = C.CUDNN_TYPE_VOID_PTR BEAttrConvolutionMode BackendAttributeType = C.CUDNN_TYPE_CONVOLUTION_MODE BEAttrHeurMode BackendAttributeType = C.CUDNN_TYPE_HEUR_MODE BEAttrKnobType BackendAttributeType = C.CUDNN_TYPE_KNOB_TYPE BEAttrNanPropogation BackendAttributeType = C.CUDNN_TYPE_NAN_PROPOGATION BEAttrNumericalNote BackendAttributeType = C.CUDNN_TYPE_NUMERICAL_NOTE BEAttrLayoutType BackendAttributeType = C.CUDNN_TYPE_LAYOUT_TYPE BEAttrAttribName BackendAttributeType = C.CUDNN_TYPE_ATTRIB_NAME BEAttrPointwiseMode BackendAttributeType = C.CUDNN_TYPE_POINTWISE_MODE BEAttrBackendDescriptor BackendAttributeType = C.CUDNN_TYPE_BACKEND_DESCRIPTOR BEAttrGenstatsMode BackendAttributeType = C.CUDNN_TYPE_GENSTATS_MODE )
func (BackendAttributeType) C ¶ added in v0.9.4
func (e BackendAttributeType) C() C.cudnnBackendAttributeType_t
C returns the C representation of BackendAttributeType
func (BackendAttributeType) String ¶ added in v0.9.4
func (e BackendAttributeType) String() string
type BackendDescriptorType ¶ added in v0.9.4
type BackendDescriptorType int
const ( BEDescriptorPointwiseDescriptor BackendDescriptorType = C.CUDNN_BACKEND_POINTWISE_DESCRIPTOR BEDescriptorConvolutionDescriptor BackendDescriptorType = C.CUDNN_BACKEND_CONVOLUTION_DESCRIPTOR BEDescriptorEngineDescriptor BackendDescriptorType = C.CUDNN_BACKEND_ENGINE_DESCRIPTOR BEDescriptorEnginecfgDescriptor BackendDescriptorType = C.CUDNN_BACKEND_ENGINECFG_DESCRIPTOR BEDescriptorEngineheurDescriptor BackendDescriptorType = C.CUDNN_BACKEND_ENGINEHEUR_DESCRIPTOR BEDescriptorExecutionPlanDescriptor BackendDescriptorType = C.CUDNN_BACKEND_EXECUTION_PLAN_DESCRIPTOR BEDescriptorIntermediateInfoDescriptor BackendDescriptorType = C.CUDNN_BACKEND_INTERMEDIATE_INFO_DESCRIPTOR BEDescriptorKnobChoiceDescriptor BackendDescriptorType = C.CUDNN_BACKEND_KNOB_CHOICE_DESCRIPTOR BEDescriptorKnobInfoDescriptor BackendDescriptorType = C.CUDNN_BACKEND_KNOB_INFO_DESCRIPTOR BEDescriptorLayoutInfoDescriptor BackendDescriptorType = C.CUDNN_BACKEND_LAYOUT_INFO_DESCRIPTOR BEDescriptorOperationConvolutionForwardDescriptor BackendDescriptorType = C.CUDNN_BACKEND_OPERATION_CONVOLUTION_FORWARD_DESCRIPTOR BEDescriptorOperationConvolutionBackwardFilterDescriptor BackendDescriptorType = C.CUDNN_BACKEND_OPERATION_CONVOLUTION_BACKWARD_FILTER_DESCRIPTOR BEDescriptorOperationConvolutionBackwardDataDescriptor BackendDescriptorType = C.CUDNN_BACKEND_OPERATION_CONVOLUTION_BACKWARD_DATA_DESCRIPTOR BEDescriptorOperationPointwiseDescriptor BackendDescriptorType = C.CUDNN_BACKEND_OPERATION_POINTWISE_DESCRIPTOR BEDescriptorOperationGenStatsDescriptor BackendDescriptorType = C.CUDNN_BACKEND_OPERATION_GEN_STATS_DESCRIPTOR BEDescriptorOperationgraphDescriptor BackendDescriptorType = C.CUDNN_BACKEND_OPERATIONGRAPH_DESCRIPTOR BEDescriptorVariantPackDescriptor BackendDescriptorType = C.CUDNN_BACKEND_VARIANT_PACK_DESCRIPTOR BEDescriptorTensorDescriptor BackendDescriptorType = C.CUDNN_BACKEND_TENSOR_DESCRIPTOR )
func (BackendDescriptorType) C ¶ added in v0.9.4
func (e BackendDescriptorType) C() C.cudnnBackendDescriptorType_t
C returns the C representation of BackendDescriptorType
func (BackendDescriptorType) String ¶ added in v0.9.4
func (e BackendDescriptorType) String() string
type BackendHeurMode ¶ added in v0.9.4
type BackendHeurMode int
const ( Instant BackendHeurMode = C.CUDNN_HEUR_MODE_INSTANT SCount BackendHeurMode = C.CUDNN_HEUR_MODES_COUNT )
func (BackendHeurMode) C ¶ added in v0.9.4
func (e BackendHeurMode) C() C.cudnnBackendHeurMode_t
C returns the C representation of BackendHeurMode
func (BackendHeurMode) String ¶ added in v0.9.4
func (e BackendHeurMode) String() string
type BackendKnobType ¶ added in v0.9.4
type BackendKnobType int
const ( SplitK BackendKnobType = C.CUDNN_KNOB_TYPE_SPLIT_K Swizzle BackendKnobType = C.CUDNN_KNOB_TYPE_SWIZZLE TileSize BackendKnobType = C.CUDNN_KNOB_TYPE_TILE_SIZE UseTex BackendKnobType = C.CUDNN_KNOB_TYPE_USE_TEX Edge BackendKnobType = C.CUDNN_KNOB_TYPE_EDGE Kblock BackendKnobType = C.CUDNN_KNOB_TYPE_KBLOCK Ldga BackendKnobType = C.CUDNN_KNOB_TYPE_LDGA Ldgb BackendKnobType = C.CUDNN_KNOB_TYPE_LDGB ChunkK BackendKnobType = C.CUDNN_KNOB_TYPE_CHUNK_K SplitH BackendKnobType = C.CUDNN_KNOB_TYPE_SPLIT_H WinoTile BackendKnobType = C.CUDNN_KNOB_TYPE_WINO_TILE Multiply BackendKnobType = C.CUDNN_KNOB_TYPE_MULTIPLY SplitKBuf BackendKnobType = C.CUDNN_KNOB_TYPE_SPLIT_K_BUF Tilek BackendKnobType = C.CUDNN_KNOB_TYPE_TILEK Stages BackendKnobType = C.CUDNN_KNOB_TYPE_STAGES ReductionMode BackendKnobType = C.CUDNN_KNOB_TYPE_REDUCTION_MODE CtaSplitKMode BackendKnobType = C.CUDNN_KNOB_TYPE_CTA_SPLIT_K_MODE SplitKSlc BackendKnobType = C.CUDNN_KNOB_TYPE_SPLIT_K_SLC IdxMode BackendKnobType = C.CUDNN_KNOB_TYPE_IDX_MODE Sliced BackendKnobType = C.CUDNN_KNOB_TYPE_SLICED SplitRs BackendKnobType = C.CUDNN_KNOB_TYPE_SPLIT_RS Singlebuffer BackendKnobType = C.CUDNN_KNOB_TYPE_SINGLEBUFFER Ldgc BackendKnobType = C.CUDNN_KNOB_TYPE_LDGC Specfilt BackendKnobType = C.CUDNN_KNOB_TYPE_SPECFILT Counts BackendKnobType = C.CUDNN_KNOB_TYPE_COUNTS )
func (BackendKnobType) C ¶ added in v0.9.4
func (e BackendKnobType) C() C.cudnnBackendKnobType_t
C returns the C representation of BackendKnobType
func (BackendKnobType) String ¶ added in v0.9.4
func (e BackendKnobType) String() string
type BackendLayoutType ¶ added in v0.9.4
type BackendLayoutType int
const ( BELayoutPreferredNchw BackendLayoutType = C.CUDNN_LAYOUT_TYPE_PREFERRED_NCHW BELayoutPreferredNhwc BackendLayoutType = C.CUDNN_LAYOUT_TYPE_PREFERRED_NHWC BELayoutPreferredPad4ck BackendLayoutType = C.CUDNN_LAYOUT_TYPE_PREFERRED_PAD4CK BELayoutPreferredPad8ck BackendLayoutType = C.CUDNN_LAYOUT_TYPE_PREFERRED_PAD8CK BELayoutCount BackendLayoutType = C.CUDNN_LAYOUT_TYPE_COUNT )
func (BackendLayoutType) C ¶ added in v0.9.4
func (e BackendLayoutType) C() C.cudnnBackendLayoutType_t
C returns the C representation of BackendLayoutType
func (BackendLayoutType) String ¶ added in v0.9.4
func (e BackendLayoutType) String() string
type BackendNumericalNote ¶ added in v0.9.4
type BackendNumericalNote int
const ( TensorCore BackendNumericalNote = C.CUDNN_NUMERICAL_NOTE_TENSOR_CORE DownConvertInputs BackendNumericalNote = C.CUDNN_NUMERICAL_NOTE_DOWN_CONVERT_INPUTS ReducedPrecisionReduction BackendNumericalNote = C.CUDNN_NUMERICAL_NOTE_REDUCED_PRECISION_REDUCTION Fft BackendNumericalNote = C.CUDNN_NUMERICAL_NOTE_FFT Nondeterministic BackendNumericalNote = C.CUDNN_NUMERICAL_NOTE_NONDETERMINISTIC Winograd BackendNumericalNote = C.CUDNN_NUMERICAL_NOTE_WINOGRAD TypeCount BackendNumericalNote = C.CUDNN_NUMERICAL_NOTE_TYPE_COUNT )
func (BackendNumericalNote) C ¶ added in v0.9.4
func (e BackendNumericalNote) C() C.cudnnBackendNumericalNote_t
C returns the C representation of BackendNumericalNote
func (BackendNumericalNote) String ¶ added in v0.9.4
func (e BackendNumericalNote) String() string
type BatchNormMode ¶
type BatchNormMode int
const ( PerActivation BatchNormMode = C.CUDNN_BATCHNORM_PER_ACTIVATION Spatial BatchNormMode = C.CUDNN_BATCHNORM_SPATIAL SpatialPersistent BatchNormMode = C.CUDNN_BATCHNORM_SPATIAL_PERSISTENT )
func (BatchNormMode) C ¶
func (e BatchNormMode) C() C.cudnnBatchNormMode_t
C returns the C representation of BatchNormMode
func (BatchNormMode) String ¶
func (e BatchNormMode) String() string
type BatchNormOps ¶ added in v0.9.4
type BatchNormOps int
const ( BatchNorm BatchNormOps = C.CUDNN_BATCHNORM_OPS_BN BatchNormActivation BatchNormOps = C.CUDNN_BATCHNORM_OPS_BN_ACTIVATION BatchNormAddActivation BatchNormOps = C.CUDNN_BATCHNORM_OPS_BN_ADD_ACTIVATION )
func (BatchNormOps) C ¶ added in v0.9.4
func (e BatchNormOps) C() C.cudnnBatchNormOps_t
C returns the C representation of BatchNormOps
func (BatchNormOps) String ¶ added in v0.9.4
func (e BatchNormOps) String() string
type CTCLoss ¶
type CTCLoss struct {
// contains filtered or unexported fields
}
CTCLoss is a representation of cudnnCTCLossDescriptor_t.
func NewCTCLoss ¶
NewCTCLoss creates a new CTCLoss.
type CTCLossAlgo ¶
type CTCLossAlgo int
const ( DeterministicCTCLoss CTCLossAlgo = C.CUDNN_CTC_LOSS_ALGO_DETERMINISTIC NonDeterministicCTCLoss CTCLossAlgo = C.CUDNN_CTC_LOSS_ALGO_NON_DETERMINISTIC )
func (CTCLossAlgo) C ¶
func (e CTCLossAlgo) C() C.cudnnCTCLossAlgo_t
C returns the C representation of CTCLossAlgo
func (CTCLossAlgo) String ¶
func (e CTCLossAlgo) String() string
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context represents the context in which cuDNN operations are performed in.
Internally, the Context holds a cudnnHandle_t
Once the context has been finished, do remember to call `Close` on the context.
func NewContext ¶
func NewContext() (retVal *Context)
NewContext creates a new Context. This is the only function that will panic if it is unable to create the context.
func (*Context) ActivationBackward ¶
func (co *Context) ActivationBackward(activationDesc *Activation, alpha float64, yDesc *TensorDescriptor, y Memory, dyDesc *TensorDescriptor, dy Memory, xDesc *TensorDescriptor, x Memory, beta float64, dxDesc *TensorDescriptor, dx Memory) error
Input. Handle to a previously created cuDNN context. For more information, see cudnnHandle_t.
func (*Context) ActivationForward ¶
func (co *Context) ActivationForward(activationDesc *Activation, alpha float64, xDesc *TensorDescriptor, x Memory, beta float64, yDesc *TensorDescriptor, y Memory) error
Input. Handle to a previously created cuDNN context. For more information, see cudnnHandle_t.
func (*Context) AddTensor ¶
func (co *Context) AddTensor(alpha float64, aDesc *TensorDescriptor, A Memory, beta float64, cDesc *TensorDescriptor, C_ Memory) error
AddTensor adds the scaled values of a bias tensor to another tensor. Each dimension of the bias tensor A must match the corresponding dimension of the destination tensor C or must be equal to 1. In the latter case, the same value from the bias tensor for those dimensions will be used to blend into the C tensor.
C_ is both an input and output
func (*Context) BatchNormalizationBackward ¶
func (co *Context) BatchNormalizationBackward(mode BatchNormMode, alphaDataDiff float64, betaDataDiff float64, alphaParamDiff float64, betaParamDiff float64, xDesc *TensorDescriptor, x Memory, dyDesc *TensorDescriptor, dy Memory, dxDesc *TensorDescriptor, dx Memory, dBnScaleBiasDesc *TensorDescriptor, bnScale Memory, dBnScaleResult Memory, dBnBiasResult Memory, epsilon float64, savedMean Memory, savedInvVariance Memory) error
For more information, see cudnnDeriveBNTensorDescriptor() for the secondary tensor descriptor generation for the parameters used in this function.
func (*Context) BatchNormalizationForwardInference ¶
func (co *Context) BatchNormalizationForwardInference(mode BatchNormMode, alpha float64, beta float64, xDesc *TensorDescriptor, x Memory, yDesc *TensorDescriptor, y Memory, bnScaleBiasMeanVarDesc *TensorDescriptor, bnScale Memory, bnBias Memory, estimatedMean Memory, estimatedVariance Memory, epsilon float64) error
Input. Handle to a previously created cuDNN library descriptor. For more information, see cudnnHandle_t.
func (*Context) BatchNormalizationForwardTraining ¶
func (co *Context) BatchNormalizationForwardTraining(mode BatchNormMode, alpha float64, beta float64, xDesc *TensorDescriptor, x Memory, yDesc *TensorDescriptor, y Memory, bnScaleBiasMeanVarDesc *TensorDescriptor, bnScale Memory, bnBias Memory, exponentialAverageFactor float64, resultRunningMean Memory, resultRunningVariance Memory, epsilon float64, resultSaveMean Memory, resultSaveInvVariance Memory) error
Handle to a previously created cuDNN library descriptor. For more information, see cudnnHandle_t.
func (*Context) ConvolutionBackwardBias ¶
func (co *Context) ConvolutionBackwardBias(alpha float64, dyDesc *TensorDescriptor, dy Memory, beta float64, dbDesc *TensorDescriptor, db Memory) error
ConvolutionBackwardBias computes the convolution function gradient with respect to the bias, which is the sum of every element belonging to the same feature map across all of the images of the input tensor. Therefore, the number of elements produced is equal to the number of features maps of the input tensor.
func (*Context) ConvolutionBackwardData ¶
func (co *Context) ConvolutionBackwardData(alpha float64, wDesc *Filter, w Memory, dyDesc *TensorDescriptor, dy Memory, convDesc *Convolution, algo ConvolutionBwdDataAlgo, workSpace Memory, workSpaceSizeInBytes uintptr, beta float64, dxDesc *TensorDescriptor, dx Memory) error
ConvolutionBackwardData computes the convolution data gradient of the tensor dy, where y is the output of the forward convolution in cudnnConvolutionForward(). It uses the specified algo, and returns the results in the output tensor dx. Scaling factors alpha and beta can be used to scale the computed result or accumulate with the current dx.
dx is both an input and output
func (*Context) ConvolutionBackwardFilter ¶
func (co *Context) ConvolutionBackwardFilter(alpha float64, xDesc *TensorDescriptor, x Memory, dyDesc *TensorDescriptor, dy Memory, convDesc *Convolution, algo ConvolutionBwdFilterAlgo, workSpace Memory, workSpaceSizeInBytes uintptr, beta float64, dwDesc *Filter, dw Memory) error
ConvolutionBackwardFilter computes the convolution weight (filter) gradient of the tensor dy, where y is the output of the forward convolution in cudnnConvolutionForward(). It uses the specified algo, and returns the results in the output tensor dw. Scaling factors alpha and beta can be used to scale the computed result or accumulate with the current dw.
dw is both an input and output
func (*Context) ConvolutionBiasActivationForward ¶
func (co *Context) ConvolutionBiasActivationForward(alpha1 float64, xDesc *TensorDescriptor, x Memory, wDesc *Filter, w Memory, convDesc *Convolution, algo ConvolutionFwdAlgo, workSpace Memory, workSpaceSizeInBytes uintptr, alpha2 float64, zDesc *TensorDescriptor, z Memory, biasDesc *TensorDescriptor, bias Memory, activationDesc *Activation, yDesc *TensorDescriptor, y Memory) error
Input. Handle to a previously created cuDNN context. For more information, see cudnnHandle_t.
y is both an input and output
func (*Context) ConvolutionForward ¶
func (co *Context) ConvolutionForward(alpha float64, xDesc *TensorDescriptor, x Memory, wDesc *Filter, w Memory, convDesc *Convolution, algo ConvolutionFwdAlgo, workSpace Memory, workSpaceSizeInBytes uintptr, beta float64, yDesc *TensorDescriptor, y Memory) error
ConvolutionForward executes convolutions or cross-correlations over x using filters specified with w, returning results in y. Scaling factors alpha and beta can be used to scale the input tensor and the output tensor respectively.
y is both an input and output
func (*Context) DivisiveNormalizationBackward ¶
func (co *Context) DivisiveNormalizationBackward(normDesc *LRN, mode DivNormMode, alpha float64, xDesc *TensorDescriptor, x Memory, means Memory, dy Memory, temp Memory, temp2 Memory, beta float64, dXdMeansDesc *TensorDescriptor, dx Memory, dMeans Memory) error
DivisiveNormalizationBackward performs the backward DivisiveNormalization layer computation.
func (*Context) DivisiveNormalizationForward ¶
func (co *Context) DivisiveNormalizationForward(normDesc *LRN, mode DivNormMode, alpha float64, xDesc *TensorDescriptor, x Memory, means Memory, temp Memory, temp2 Memory, beta float64, yDesc *TensorDescriptor, y Memory) error
The x-mean(x) which is often referred to as `subtractive normalization` portion of the computation can be implemented using cuDNN average pooling layer followed by a call to addTensor.
func (*Context) DoOp ¶
func (ctx *Context) DoOp(op *Op, alpha1 float64, aDesc *TensorDescriptor, aData Memory, alpha2 float64, bDesc *TensorDescriptor, bData Memory, beta float64, cDesc *TensorDescriptor, cData Memory) error
DoOp actually performs the operation.
func (*Context) DropoutBackward ¶
func (co *Context) DropoutBackward(dropoutDesc *Dropout, dydesc *TensorDescriptor, dy Memory, dxdesc *TensorDescriptor, dx Memory, reserveSpace Memory, reserveSpaceSizeInBytes uintptr) error
DropoutBackward performs backward dropout operation over dy returning results in dx. If during forward dropout operation value from x was propagated to y then during backward operation value from dy will be propagated to dx, otherwise, dx value will be set to 0.
func (*Context) DropoutForward ¶
func (co *Context) DropoutForward(dropoutDesc *Dropout, xdesc *TensorDescriptor, x Memory, ydesc *TensorDescriptor, y Memory, reserveSpace Memory, reserveSpaceSizeInBytes uintptr) error
DropoutForward performs forward dropout operation over x returning results in y. If dropout was used as a parameter to cudnnSetDropoutDescriptor(), the approximately dropout fraction of x values will be replaced by a 0, and the rest will be scaled by 1/(1-dropout). DropoutForward should not be running concurrently with another DropoutForward() function using the same states.
func (*Context) DropoutGetStatesSize ¶
DropoutGetStatesSize is used to query the amount of space required to store the states of the random number generators used by cudnnDropoutForward() function.
func (*Context) FindConvolutionBackwardDataAlgorithm ¶ added in v0.9.4
func (co *Context) FindConvolutionBackwardDataAlgorithm(wDesc *Filter, dyDesc *TensorDescriptor, convDesc *Convolution, dxDesc *TensorDescriptor, requestedAlgoCount int) (returnedAlgoCount int, perfResults *ConvolutionBwdDataPerf, err error)
FindConvolutionBackwardDataAlgorithm attempts all algorithms available for cudnnConvolutionBackwardData(). It will attempt both the provided convDescmathType and CUDNN_DEFAULT_MATH (assuming the two differ).
func (*Context) FindConvolutionBackwardDataAlgorithmEx ¶ added in v0.9.4
func (co *Context) FindConvolutionBackwardDataAlgorithmEx(wDesc *Filter, w Memory, dyDesc *TensorDescriptor, dy Memory, convDesc *Convolution, dxDesc *TensorDescriptor, dx Memory, requestedAlgoCount int, workSpace Memory, workSpaceSizeInBytes uintptr) (returnedAlgoCount int, perfResults *ConvolutionBwdDataPerf, err error)
FindConvolutionBackwardDataAlgorithmEx attempts all algorithms available for cudnnConvolutionBackwardData(). It will attempt both the provided convDescmathType and CUDNN_DEFAULT_MATH (assuming the two differ).
dxDesc is both an input and output
func (*Context) FindConvolutionBackwardFilterAlgorithm ¶ added in v0.9.4
func (co *Context) FindConvolutionBackwardFilterAlgorithm(xDesc *TensorDescriptor, dyDesc *TensorDescriptor, convDesc *Convolution, dwDesc *Filter, requestedAlgoCount int) (returnedAlgoCount int, perfResults *ConvolutionBwdPerf, err error)
FindConvolutionBackwardFilterAlgorithm attempts all algorithms available for cudnnConvolutionBackwardFilter(). It will attempt both the provided convDescmathType and CUDNN_DEFAULT_MATH (assuming the two differ).
func (*Context) FindConvolutionBackwardFilterAlgorithmEx ¶ added in v0.9.4
func (co *Context) FindConvolutionBackwardFilterAlgorithmEx(xDesc *TensorDescriptor, x Memory, dyDesc *TensorDescriptor, y Memory, convDesc *Convolution, dwDesc *Filter, dw Memory, requestedAlgoCount int, workSpace Memory, workSpaceSizeInBytes uintptr) (returnedAlgoCount int, perfResults *ConvolutionBwdPerf, err error)
FindConvolutionBackwardFilterAlgorithmEx attempts all algorithms available for cudnnConvolutionBackwardFilter(). It will attempt both the provided convDescmathType and CUDNN_DEFAULT_MATH (assuming the two differ).
dw is both an input and output
func (*Context) FindConvolutionForwardAlgorithm ¶ added in v0.9.4
func (co *Context) FindConvolutionForwardAlgorithm(xDesc *TensorDescriptor, wDesc *Filter, convDesc *Convolution, yDesc *TensorDescriptor, requestedAlgoCount int) (returnedAlgoCount int, perfResults *ConvolutionFwdPerf, err error)
FindConvolutionForwardAlgorithm attempts all algorithms available for cudnnConvolutionForward(). It will attempt both the provided convDescmathType and CUDNN_DEFAULT_MATH (assuming the two differ).
func (*Context) FindConvolutionForwardAlgorithmEx ¶ added in v0.9.4
func (co *Context) FindConvolutionForwardAlgorithmEx(xDesc *TensorDescriptor, x Memory, wDesc *Filter, w Memory, convDesc *Convolution, yDesc *TensorDescriptor, y Memory, requestedAlgoCount int, workSpace Memory, workSpaceSizeInBytes uintptr) (returnedAlgoCount int, perfResults *ConvolutionFwdPerf, err error)
FindConvolutionForwardAlgorithmEx attempts all algorithms available for cudnnConvolutionForward(). It will attempt both the provided convDescmathType and CUDNN_DEFAULT_MATH (assuming the two differ).
y is both an input and output
func (*Context) GetReductionIndicesSize ¶
func (co *Context) GetReductionIndicesSize(reduceTensorDesc *Reduction, aDesc *TensorDescriptor, cDesc *TensorDescriptor) (sizeInBytes uintptr, err error)
GetReductionIndicesSize is a helper function to return the minimum size of the index space to be passed to the reduction given the input and output tensors.
func (*Context) GetReductionWorkspaceSize ¶
func (co *Context) GetReductionWorkspaceSize(reduceTensorDesc *Reduction, aDesc *TensorDescriptor, cDesc *TensorDescriptor) (sizeInBytes uintptr, err error)
GetReductionWorkspaceSize is a helper function to return the minimum size of the workspace to be passed to the reduction given the input and output tensors.
func (*Context) Im2Col ¶
func (co *Context) Im2Col(xDesc *TensorDescriptor, x Memory, wDesc *Filter, convDesc *Convolution, colBuffer Memory) error
Input. Handle to a previously created cuDNN context.
func (*Context) LRNCrossChannelBackward ¶
func (co *Context) LRNCrossChannelBackward(normDesc *LRN, lrnMode LRNMode, alpha float64, yDesc *TensorDescriptor, y Memory, dyDesc *TensorDescriptor, dy Memory, xDesc *TensorDescriptor, x Memory, beta float64, dx Memory) (dxDesc *TensorDescriptor, err error)
LRNCrossChannelBackward performs the backward LRN layer computation.
func (*Context) LRNCrossChannelForward ¶
func (co *Context) LRNCrossChannelForward(normDesc *LRN, lrnMode LRNMode, alpha float64, xDesc *TensorDescriptor, x Memory, beta float64, yDesc *TensorDescriptor, y Memory) error
LRNCrossChannelForward performs the forward LRN layer computation.
func (*Context) OpTensor ¶
func (co *Context) OpTensor(opTensorDesc *Op, alpha1 float64, aDesc *TensorDescriptor, A Memory, alpha2 float64, bDesc *TensorDescriptor, B Memory, beta float64, cDesc *TensorDescriptor, C_ Memory) error
OpTensor implements the equation C = op(alpha1[0] * A, alpha2[0] * B) + beta[0] * C, given the tensors A, B, and C and the scaling factors alpha1, alpha2, and beta. The op to use is indicated by the descriptor OpTensorDescriptor_t, meaning, the type of opTensorDesc. Currently-supported ops are listed by the OpTensorOp_t enum.
C_ is both an input and output
func (*Context) PoolingBackward ¶
func (co *Context) PoolingBackward(poolingDesc *Pooling, alpha float64, yDesc *TensorDescriptor, y Memory, dyDesc *TensorDescriptor, dy Memory, xDesc *TensorDescriptor, x Memory, beta float64, dxDesc *TensorDescriptor, dx Memory) error
PoolingBackward computes the gradient of a pooling operation.
func (*Context) PoolingForward ¶
func (co *Context) PoolingForward(poolingDesc *Pooling, alpha float64, xDesc *TensorDescriptor, x Memory, beta float64, yDesc *TensorDescriptor, y Memory) error
PoolingForward computes pooling of input values (meaning, the maximum or average of several adjacent values) to produce an output with smaller height and/or width.
func (*Context) ReduceTensor ¶
func (co *Context) ReduceTensor(reduceTensorDesc *Reduction, indices Memory, indicesSizeInBytes uintptr, workspace Memory, workspaceSizeInBytes uintptr, alpha float64, aDesc *TensorDescriptor, A Memory, beta float64, cDesc *TensorDescriptor, C_ Memory) error
ReduceTensor reduces tensor A by implementing the equation C = alpha * reduce op ( A ) + beta * C, given tensors A and C and scaling factors alpha and beta. The reduction op to use is indicated by the descriptor reduceTensorDesc. Currently-supported ops are listed by the ReduceTensorOp_t enum.
C_ is both an input and output
func (*Context) ScaleTensor ¶
func (co *Context) ScaleTensor(yDesc *TensorDescriptor, y Memory, alpha float64) error
ScaleTensor scales all the elements of a tensor by a given factor.
y is both an input and output
func (*Context) SoftmaxBackward ¶
func (co *Context) SoftmaxBackward(algo SoftmaxAlgorithm, mode SoftmaxMode, alpha float64, yDesc *TensorDescriptor, y Memory, dyDesc *TensorDescriptor, dy Memory, beta float64, dxDesc *TensorDescriptor, dx Memory) error
SoftmaxBackward computes the gradient of the softmax function.
func (*Context) SoftmaxForward ¶
func (co *Context) SoftmaxForward(algo SoftmaxAlgorithm, mode SoftmaxMode, alpha float64, xDesc *TensorDescriptor, x Memory, beta float64, yDesc *TensorDescriptor, y Memory) error
SoftmaxForward computes the softmax function.
func (*Context) SpatialTfGridGeneratorBackward ¶
func (co *Context) SpatialTfGridGeneratorBackward(stDesc *SpatialTransformer, dgrid Memory, dtheta Memory) error
SpatialTfGridGeneratorBackward computes the gradient of a grid generation operation.
func (*Context) SpatialTfGridGeneratorForward ¶
func (co *Context) SpatialTfGridGeneratorForward(stDesc *SpatialTransformer, theta Memory, grid Memory) error
SpatialTfGridGeneratorForward generates a grid of coordinates in the input tensor corresponding to each pixel from the output tensor.
func (*Context) SpatialTfSamplerBackward ¶
func (co *Context) SpatialTfSamplerBackward(stDesc *SpatialTransformer, alpha float64, xDesc *TensorDescriptor, x Memory, beta float64, dxDesc *TensorDescriptor, dx Memory, alphaDgrid Memory, dyDesc *TensorDescriptor, dy Memory, grid Memory, betaDgrid Memory, dgrid Memory) error
SpatialTfSamplerBackward computes the gradient of a sampling operation.
func (*Context) SpatialTfSamplerForward ¶
func (co *Context) SpatialTfSamplerForward(stDesc *SpatialTransformer, alpha float64, xDesc *TensorDescriptor, x Memory, grid Memory, beta float64, yDesc *TensorDescriptor, y Memory) error
SpatialTfSamplerForward performs a sampler operation and generates the output tensor using the grid given by the grid generator.
func (*Context) TransformTensor ¶
func (co *Context) TransformTensor(alpha float64, xDesc *TensorDescriptor, x Memory, beta float64, yDesc *TensorDescriptor, y Memory) error
TransformTensor copies the scaled data from one tensor to another tensor with a different layout. Those descriptors need to have the same dimensions but not necessarily the same strides. The input and output tensors must not overlap in any way (meaning, tensors cannot be transformed in place). TransformTensor can be used to convert a tensor with an unsupported format to a supported one.
type Convolution ¶
type Convolution struct {
// contains filtered or unexported fields
}
Convolution is a struct describing the convolution operations. Internally it holds a cudnnConvolutionDescriptor_t, which will be passed around when making cgo calls.
func NewConvolution ¶
func NewConvolution(mathType MathType, groupCount int, padding, filterStride, dilation []int, convolutionMode ConvolutionMode, datatype DataType) (retVal *Convolution, err error)
func (*Convolution) CalcForwardOutputShape ¶
func (c *Convolution) CalcForwardOutputShape(input *TensorDescriptor, filter *Filter, dims int) (retVal []int, err error)
func (*Convolution) Dilation ¶
func (c *Convolution) Dilation() []int
func (*Convolution) FilterStride ¶
func (c *Convolution) FilterStride() []int
func (*Convolution) ForwardOutputShape ¶
func (c *Convolution) ForwardOutputShape(input *TensorDescriptor, filter *Filter, dims int) (retVal []int, err error)
func (*Convolution) GroupCount ¶
func (c *Convolution) GroupCount() int
func (*Convolution) MathType ¶
func (c *Convolution) MathType() MathType
func (*Convolution) Padding ¶
func (c *Convolution) Padding() []int
type ConvolutionBwdDataAlgo ¶
type ConvolutionBwdDataAlgo int
const ( ConvolutionBwdDataAlgo0 ConvolutionBwdDataAlgo = C.CUDNN_CONVOLUTION_BWD_DATA_ALGO_0 ConvolutionBwdDataAlgo1 ConvolutionBwdDataAlgo = C.CUDNN_CONVOLUTION_BWD_DATA_ALGO_1 ConvolutionBwdDataAlgoFFT ConvolutionBwdDataAlgo = C.CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT ConvolutionBwdDataAlgoFFTTiling ConvolutionBwdDataAlgo = C.CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT_TILING ConvolutionBwdDataAlgoWinograd ConvolutionBwdDataAlgo = C.CUDNN_CONVOLUTION_BWD_DATA_ALGO_WINOGRAD ConvolutionBwdDataAlgoWinogradNonfused ConvolutionBwdDataAlgo = C.CUDNN_CONVOLUTION_BWD_DATA_ALGO_WINOGRAD_NONFUSED ConvolutionBwdDataAlgoCount ConvolutionBwdDataAlgo = C.CUDNN_CONVOLUTION_BWD_DATA_ALGO_COUNT )
func (ConvolutionBwdDataAlgo) C ¶
func (c ConvolutionBwdDataAlgo) C() C.cudnnConvolutionBwdDataAlgo_t
type ConvolutionBwdDataPerf ¶
type ConvolutionBwdDataPerf struct { Algo ConvolutionBwdDataAlgo Err error Time float64 Memory uintptr // size Determinism Determinism MathType MathType // contains filtered or unexported fields }
func ConvolutionBwdDataPerfFromC ¶
func ConvolutionBwdDataPerfFromC(p C.cudnnConvolutionBwdDataAlgoPerf_t) *ConvolutionBwdDataPerf
type ConvolutionBwdFilterAlgo ¶
type ConvolutionBwdFilterAlgo int
const ( ConvolutionBwdFilterAlgo0 ConvolutionBwdFilterAlgo = C.CUDNN_CONVOLUTION_BWD_FILTER_ALGO_0 ConvolutionBwdFilterAlgo1 ConvolutionBwdFilterAlgo = C.CUDNN_CONVOLUTION_BWD_FILTER_ALGO_1 ConvolutionBwdFilterAlgoFFT ConvolutionBwdFilterAlgo = C.CUDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT ConvolutionBwdFilterAlgo3 ConvolutionBwdFilterAlgo = C.CUDNN_CONVOLUTION_BWD_FILTER_ALGO_3 ConvolutionBwdFilterAlgoWinograd ConvolutionBwdFilterAlgo = C.CUDNN_CONVOLUTION_BWD_FILTER_ALGO_WINOGRAD ConvolutionBwdFilterAlgoWinogradNonfused ConvolutionBwdFilterAlgo = C.CUDNN_CONVOLUTION_BWD_FILTER_ALGO_WINOGRAD_NONFUSED ConvolutionBwdFilterAlgoFFTTiling ConvolutionBwdFilterAlgo = C.CUDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT_TILING ConvolutionBwdFilterAlgoCount ConvolutionBwdFilterAlgo = C.CUDNN_CONVOLUTION_BWD_FILTER_ALGO_COUNT )
func (ConvolutionBwdFilterAlgo) C ¶
func (c ConvolutionBwdFilterAlgo) C() C.cudnnConvolutionBwdFilterAlgo_t
type ConvolutionBwdPerf ¶
type ConvolutionBwdPerf struct { Err error Algo ConvolutionBwdFilterAlgo Time float64 Memory uintptr // size Determinism Determinism MathType MathType // contains filtered or unexported fields }
type ConvolutionFwdAlgo ¶
type ConvolutionFwdAlgo int
const ( ConvolutionFwdAlgoImplicitGemm ConvolutionFwdAlgo = C.CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_GEMM ConvolutionFwdAlgoImplicitPrecompGemm ConvolutionFwdAlgo = C.CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_PRECOMP_GEMM ConvolutionFwdAlgoGemm ConvolutionFwdAlgo = C.CUDNN_CONVOLUTION_FWD_ALGO_GEMM ConvolutionFwdAlgoDirect ConvolutionFwdAlgo = C.CUDNN_CONVOLUTION_FWD_ALGO_DIRECT ConvolutionFwdAlgoFFT ConvolutionFwdAlgo = C.CUDNN_CONVOLUTION_FWD_ALGO_FFT ConvolutionFwdAlgoFFTTiling ConvolutionFwdAlgo = C.CUDNN_CONVOLUTION_FWD_ALGO_FFT_TILING ConvolutionFwdAlgoWinograd ConvolutionFwdAlgo = C.CUDNN_CONVOLUTION_FWD_ALGO_WINOGRAD ConvolutionFwdAlgoWinogradNonfused ConvolutionFwdAlgo = C.CUDNN_CONVOLUTION_FWD_ALGO_WINOGRAD_NONFUSED ConvolutionFwdAlgoCount ConvolutionFwdAlgo = C.CUDNN_CONVOLUTION_FWD_ALGO_COUNT )
func (ConvolutionFwdAlgo) C ¶
func (c ConvolutionFwdAlgo) C() C.cudnnConvolutionFwdAlgo_t
type ConvolutionFwdPerf ¶
type ConvolutionFwdPerf struct { Algo ConvolutionFwdAlgo Time float64 Memory uintptr // size Determinism Determinism MathType MathType Err error // contains filtered or unexported fields }
TODO
type ConvolutionMode ¶
type ConvolutionMode int
const ( StandardConvolution ConvolutionMode = C.CUDNN_CONVOLUTION CrossCorrelation ConvolutionMode = C.CUDNN_CROSS_CORRELATION )
func (ConvolutionMode) C ¶
func (e ConvolutionMode) C() C.cudnnConvolutionMode_t
C returns the C representation of ConvolutionMode
type ConvolutionPreference ¶
type ConvolutionPreference byte
ConvolutionPreference represents the preference for the algorithm to work with.
Coincidentally ALL the preferences share the same three enum numbers, so we roll them into one Go type.
const ( NoWorkspace ConvolutionPreference = iota PreferFastest SpecifyWorkspaceLimit )
func MakeConvolutionPreference ¶
func MakeConvolutionPreference(t ConvolutionType, pref ConvolutionPreference) ConvolutionPreference
MakeConvolutionPreference allows the creation of a tagged preference - whether it's fwd, bwd or data or filter
func (ConvolutionPreference) C ¶
func (c ConvolutionPreference) C() C.int
C returns the C representation. Note this is only OK to do because all the ConvolutionPreferences share the ssame enum ints.
This may break
func (ConvolutionPreference) IsBwd ¶
func (c ConvolutionPreference) IsBwd() bool
func (ConvolutionPreference) IsData ¶
func (c ConvolutionPreference) IsData() bool
func (ConvolutionPreference) IsFilter ¶
func (c ConvolutionPreference) IsFilter() bool
func (ConvolutionPreference) IsFwd ¶
func (c ConvolutionPreference) IsFwd() bool
func (ConvolutionPreference) Pref ¶
func (c ConvolutionPreference) Pref() ConvolutionPreference
type ConvolutionType ¶
type ConvolutionType byte
type DataType ¶
type DataType int
const ( Float DataType = C.CUDNN_DATA_FLOAT Double DataType = C.CUDNN_DATA_DOUBLE Half DataType = C.CUDNN_DATA_HALF Int8 DataType = C.CUDNN_DATA_INT8 Int32 DataType = C.CUDNN_DATA_INT32 Int8x4 DataType = C.CUDNN_DATA_INT8x4 Uint8 DataType = C.CUDNN_DATA_UINT8 Uint8x4 DataType = C.CUDNN_DATA_UINT8x4 Int8x32 DataType = C.CUDNN_DATA_INT8x32 )
func (DataType) C ¶
func (e DataType) C() C.cudnnDataType_t
C returns the C representation of DataType
type Determinism ¶
type Determinism int
const ( NonDeterministic Determinism = C.CUDNN_NON_DETERMINISTIC Deterministic Determinism = C.CUDNN_DETERMINISTIC )
func (Determinism) C ¶
func (e Determinism) C() C.cudnnDeterminism_t
C returns the C representation of Determinism
func (Determinism) String ¶
func (e Determinism) String() string
type DirectionMode ¶
type DirectionMode int
const ( Unidirectional DirectionMode = C.CUDNN_UNIDIRECTIONAL Bidirectional DirectionMode = C.CUDNN_BIDIRECTIONAL )
func (DirectionMode) C ¶
func (e DirectionMode) C() C.cudnnDirectionMode_t
C returns the C representation of DirectionMode
func (DirectionMode) String ¶
func (e DirectionMode) String() string
type DivNormMode ¶
type DivNormMode int
const (
PrecomputedMeans DivNormMode = C.CUDNN_DIVNORM_PRECOMPUTED_MEANS
)
func (DivNormMode) C ¶
func (e DivNormMode) C() C.cudnnDivNormMode_t
C returns the C representation of DivNormMode
func (DivNormMode) String ¶
func (e DivNormMode) String() string
type Dropout ¶
type Dropout struct {
// contains filtered or unexported fields
}
Dropout is a representation of cudnnDropoutDescriptor_t.
The usecase of Dropout is quite different from the rest of the APIs in this library. There is a two stage API:
drop := NewDropout(...) drop.Use(ctx, states....)
This is because the Dropout is largely tied to run-time. An additional `.IsReady` method is added to indicate if the dropout state is ready to be used
However, if your runtime is known ahead of time, the `NewDropoutWithContext` creation function can be used.
func NewDropout ¶
NewDropout creates a Dropout descriptor. It is not usable by default because some additional stateful information needs to be passed in
func NewDropoutWithContext ¶
func NewDropoutWithContext(dropout float64, handle *Context, states Memory, stateSizeInBytes uintptr, seed uint64) (retVal *Dropout, err error)
NewDropout creates a new Dropout with the given context (handle, states, etc)
func (*Dropout) RequiredStateSize ¶
func (*Dropout) Reset ¶
func (dr *Dropout) Reset()
Reset resets the state to be not ready. It does NOT reset the dropout ratio.
func (*Dropout) RestoreDropoutDescriptor ¶
func (dr *Dropout) RestoreDropoutDescriptor(handle *Context, dropout float32, states Memory, stateSizeInBytes uintptr, seed uint64) error
RestoreDropoutDescriptor restores a dropout descriptor to a previously saved-off state.
func (*Dropout) StateSizeInBytes ¶
StateSizeInBytes returns the internal stateSizeInBytes.
type ErrQueryMode ¶
type ErrQueryMode int
const ( Rawcode ErrQueryMode = C.CUDNN_ERRQUERY_RAWCODE Nonblocking ErrQueryMode = C.CUDNN_ERRQUERY_NONBLOCKING Blocking ErrQueryMode = C.CUDNN_ERRQUERY_BLOCKING )
func (ErrQueryMode) C ¶
func (e ErrQueryMode) C() C.cudnnErrQueryMode_t
C returns the C representation of ErrQueryMode
func (ErrQueryMode) String ¶
func (e ErrQueryMode) String() string
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter is a representation of cudnnFilterDescriptor_t.
func NewFilter ¶
func NewFilter(dataType DataType, format TensorFormat, shape []int) (retVal *Filter, err error)
NewFilter creates a new Filter.
func (*Filter) Format ¶
func (f *Filter) Format() TensorFormat
Filter returns the TensorFormat of the filter
type FoldingDirection ¶ added in v0.9.4
type FoldingDirection int
const ( Fold FoldingDirection = C.CUDNN_TRANSFORM_FOLD Unfold FoldingDirection = C.CUDNN_TRANSFORM_UNFOLD )
func (FoldingDirection) C ¶ added in v0.9.4
func (e FoldingDirection) C() C.cudnnFoldingDirection_t
C returns the C representation of FoldingDirection
func (FoldingDirection) String ¶ added in v0.9.4
func (e FoldingDirection) String() string
type ForwardMode ¶ added in v0.9.4
type ForwardMode int
const ( Inference ForwardMode = C.CUDNN_FWD_MODE_INFERENCE Training ForwardMode = C.CUDNN_FWD_MODE_TRAINING )
func (ForwardMode) C ¶ added in v0.9.4
func (e ForwardMode) C() C.cudnnForwardMode_t
C returns the C representation of ForwardMode
func (ForwardMode) String ¶ added in v0.9.4
func (e ForwardMode) String() string
type FusedOpConsts ¶ added in v0.9.4
type FusedOpConsts struct {
// contains filtered or unexported fields
}
FusedOpConsts is a representation of cudnnFusedOpsConstParamPack_t.
func NewFusedOpConsts ¶ added in v0.9.4
func NewFusedOpConsts(ops FusedOps, paramLabel FusedOpsConstParamLabel, param Memory) (retVal *FusedOpConsts, err error)
NewFusedOpConsts creates a new FusedOpConsts.
func (*FusedOpConsts) C ¶ added in v0.9.4
func (f *FusedOpConsts) C() C.cudnnFusedOpsConstParamPack_t
C returns the internal cgo representation.
func (*FusedOpConsts) Ops ¶ added in v0.9.4
func (f *FusedOpConsts) Ops() FusedOps
Ops returns the ops that were fused.
func (*FusedOpConsts) Param ¶ added in v0.9.4
func (f *FusedOpConsts) Param() Memory
Param returns the internal param.
func (*FusedOpConsts) ParamLabel ¶ added in v0.9.4
func (f *FusedOpConsts) ParamLabel() FusedOpsConstParamLabel
ParamLabel returns the internal paramLabel.
type FusedOpVariantParams ¶ added in v0.9.4
type FusedOpVariantParams struct {
// contains filtered or unexported fields
}
FusedOpVariantParams is a representation of cudnnFusedOpsVariantParamPack_t.
func NewFusedOpVariantParams ¶ added in v0.9.4
func NewFusedOpVariantParams(ops FusedOps, paramLabel FusedOpsVariantParamLabel, ptr Memory) (retVal *FusedOpVariantParams, err error)
NewFusedOpVariantParams creates a new FusedOpVariantParams.
func (*FusedOpVariantParams) C ¶ added in v0.9.4
func (f *FusedOpVariantParams) C() C.cudnnFusedOpsVariantParamPack_t
C returns the internal cgo representation.
func (*FusedOpVariantParams) Ops ¶ added in v0.9.4
func (f *FusedOpVariantParams) Ops() FusedOps
Ops returns the ops that are fused.
func (*FusedOpVariantParams) ParamLabel ¶ added in v0.9.4
func (f *FusedOpVariantParams) ParamLabel() FusedOpsVariantParamLabel
ParamLabel returns the internal paramLabel.
func (*FusedOpVariantParams) Ptr ¶ added in v0.9.4
func (f *FusedOpVariantParams) Ptr() Memory
Ptr returns the internal ptr.
type FusedOps ¶ added in v0.9.4
type FusedOps int
const ( ScaleBiasActivationConvBnstats FusedOps = C.CUDNN_FUSED_SCALE_BIAS_ACTIVATION_CONV_BNSTATS ScaleBiasActivationWgrad FusedOps = C.CUDNN_FUSED_SCALE_BIAS_ACTIVATION_WGRAD BnFinalizeStatisticsTraining FusedOps = C.CUDNN_FUSED_BN_FINALIZE_STATISTICS_TRAINING BnFinalizeStatisticsInference FusedOps = C.CUDNN_FUSED_BN_FINALIZE_STATISTICS_INFERENCE ConvScaleBiasAddActivation FusedOps = C.CUDNN_FUSED_CONV_SCALE_BIAS_ADD_ACTIVATION ScaleBiasAddActivationGenBitmask FusedOps = C.CUDNN_FUSED_SCALE_BIAS_ADD_ACTIVATION_GEN_BITMASK DactivationForkDbatchnorm FusedOps = C.CUDNN_FUSED_DACTIVATION_FORK_DBATCHNORM )
func (FusedOps) C ¶ added in v0.9.4
func (e FusedOps) C() C.cudnnFusedOps_t
C returns the C representation of FusedOps
type FusedOpsConstParamLabel ¶ added in v0.9.4
type FusedOpsConstParamLabel int
const ( Xdesc FusedOpsConstParamLabel = C.CUDNN_PARAM_XDESC XdataPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_XDATA_PLACEHOLDER BnMode FusedOpsConstParamLabel = C.CUDNN_PARAM_BN_MODE BnEqscalebiasDesc FusedOpsConstParamLabel = C.CUDNN_PARAM_BN_EQSCALEBIAS_DESC BnEqscalePlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_BN_EQSCALE_PLACEHOLDER BnEqbiasPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_BN_EQBIAS_PLACEHOLDER ActivationDesc FusedOpsConstParamLabel = C.CUDNN_PARAM_ACTIVATION_DESC ConvDesc FusedOpsConstParamLabel = C.CUDNN_PARAM_CONV_DESC Wdesc FusedOpsConstParamLabel = C.CUDNN_PARAM_WDESC WdataPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_WDATA_PLACEHOLDER Dwdesc FusedOpsConstParamLabel = C.CUDNN_PARAM_DWDESC DwdataPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_DWDATA_PLACEHOLDER Ydesc FusedOpsConstParamLabel = C.CUDNN_PARAM_YDESC YdataPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_YDATA_PLACEHOLDER Dydesc FusedOpsConstParamLabel = C.CUDNN_PARAM_DYDESC DydataPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_DYDATA_PLACEHOLDER YstatsDesc FusedOpsConstParamLabel = C.CUDNN_PARAM_YSTATS_DESC YsumPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_YSUM_PLACEHOLDER YsqsumPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_YSQSUM_PLACEHOLDER BnScalebiasMeanvarDesc FusedOpsConstParamLabel = C.CUDNN_PARAM_BN_SCALEBIAS_MEANVAR_DESC BnScalePlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_BN_SCALE_PLACEHOLDER BnBiasPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_BN_BIAS_PLACEHOLDER BnSavedMeanPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_BN_SAVED_MEAN_PLACEHOLDER BnSavedInvstdPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_BN_SAVED_INVSTD_PLACEHOLDER BnRunningMeanPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_BN_RUNNING_MEAN_PLACEHOLDER BnRunningVarPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_BN_RUNNING_VAR_PLACEHOLDER Zdesc FusedOpsConstParamLabel = C.CUDNN_PARAM_ZDESC ZdataPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_ZDATA_PLACEHOLDER BnZEqscalebiasDesc FusedOpsConstParamLabel = C.CUDNN_PARAM_BN_Z_EQSCALEBIAS_DESC BnZEqscalePlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_BN_Z_EQSCALE_PLACEHOLDER BnZEqbiasPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_BN_Z_EQBIAS_PLACEHOLDER ActivationBitmaskDesc FusedOpsConstParamLabel = C.CUDNN_PARAM_ACTIVATION_BITMASK_DESC ActivationBitmaskPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_ACTIVATION_BITMASK_PLACEHOLDER Dxdesc FusedOpsConstParamLabel = C.CUDNN_PARAM_DXDESC DxdataPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_DXDATA_PLACEHOLDER Dzdesc FusedOpsConstParamLabel = C.CUDNN_PARAM_DZDESC DzdataPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_DZDATA_PLACEHOLDER BnDscalePlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_BN_DSCALE_PLACEHOLDER BnDbiasPlaceholder FusedOpsConstParamLabel = C.CUDNN_PARAM_BN_DBIAS_PLACEHOLDER )
func (FusedOpsConstParamLabel) C ¶ added in v0.9.4
func (e FusedOpsConstParamLabel) C() C.cudnnFusedOpsConstParamLabel_t
C returns the C representation of FusedOpsConstParamLabel
func (FusedOpsConstParamLabel) String ¶ added in v0.9.4
func (e FusedOpsConstParamLabel) String() string
type FusedOpsPointerPlaceHolder ¶ added in v0.9.4
type FusedOpsPointerPlaceHolder int
const ( NullPtr FusedOpsPointerPlaceHolder = C.CUDNN_PTR_NULL PtrElemAligned FusedOpsPointerPlaceHolder = C.CUDNN_PTR_ELEM_ALIGNED Ptr16 FusedOpsPointerPlaceHolder = C.CUDNN_PTR_16B_ALIGNED )
func (FusedOpsPointerPlaceHolder) C ¶ added in v0.9.4
func (e FusedOpsPointerPlaceHolder) C() C.cudnnFusedOpsPointerPlaceHolder_t
C returns the C representation of FusedOpsPointerPlaceHolder
func (FusedOpsPointerPlaceHolder) String ¶ added in v0.9.4
func (e FusedOpsPointerPlaceHolder) String() string
type FusedOpsVariantParamLabel ¶ added in v0.9.4
type FusedOpsVariantParamLabel int
const ( PtrXdata FusedOpsVariantParamLabel = C.CUDNN_PTR_XDATA PtrBnEqscale FusedOpsVariantParamLabel = C.CUDNN_PTR_BN_EQSCALE PtrBnEqbias FusedOpsVariantParamLabel = C.CUDNN_PTR_BN_EQBIAS PtrWdata FusedOpsVariantParamLabel = C.CUDNN_PTR_WDATA PtrDwdata FusedOpsVariantParamLabel = C.CUDNN_PTR_DWDATA PtrYdata FusedOpsVariantParamLabel = C.CUDNN_PTR_YDATA PtrDydata FusedOpsVariantParamLabel = C.CUDNN_PTR_DYDATA PtrYsum FusedOpsVariantParamLabel = C.CUDNN_PTR_YSUM PtrYsqsum FusedOpsVariantParamLabel = C.CUDNN_PTR_YSQSUM PtrWorkspace FusedOpsVariantParamLabel = C.CUDNN_PTR_WORKSPACE PtrBnScale FusedOpsVariantParamLabel = C.CUDNN_PTR_BN_SCALE PtrBnBias FusedOpsVariantParamLabel = C.CUDNN_PTR_BN_BIAS PtrBnSavedMean FusedOpsVariantParamLabel = C.CUDNN_PTR_BN_SAVED_MEAN PtrBnSavedInvstd FusedOpsVariantParamLabel = C.CUDNN_PTR_BN_SAVED_INVSTD PtrBnRunningMean FusedOpsVariantParamLabel = C.CUDNN_PTR_BN_RUNNING_MEAN PtrBnRunningVar FusedOpsVariantParamLabel = C.CUDNN_PTR_BN_RUNNING_VAR PtrZdata FusedOpsVariantParamLabel = C.CUDNN_PTR_ZDATA PtrBnZEqscale FusedOpsVariantParamLabel = C.CUDNN_PTR_BN_Z_EQSCALE PtrBnZEqbias FusedOpsVariantParamLabel = C.CUDNN_PTR_BN_Z_EQBIAS PtrActivationBitmask FusedOpsVariantParamLabel = C.CUDNN_PTR_ACTIVATION_BITMASK PtrDxdata FusedOpsVariantParamLabel = C.CUDNN_PTR_DXDATA PtrDzdata FusedOpsVariantParamLabel = C.CUDNN_PTR_DZDATA PtrBnDscale FusedOpsVariantParamLabel = C.CUDNN_PTR_BN_DSCALE PtrBnDbias FusedOpsVariantParamLabel = C.CUDNN_PTR_BN_DBIAS ScalarSizeTWorkspaceSizeInBytes FusedOpsVariantParamLabel = C.CUDNN_SCALAR_SIZE_T_WORKSPACE_SIZE_IN_BYTES ScalarInt64TBnAccumulationCount FusedOpsVariantParamLabel = C.CUDNN_SCALAR_INT64_T_BN_ACCUMULATION_COUNT ScalarDoubleBnExpAvgFactor FusedOpsVariantParamLabel = C.CUDNN_SCALAR_DOUBLE_BN_EXP_AVG_FACTOR ScalarDoubleBnEpsilon FusedOpsVariantParamLabel = C.CUDNN_SCALAR_DOUBLE_BN_EPSILON )
func (FusedOpsVariantParamLabel) C ¶ added in v0.9.4
func (e FusedOpsVariantParamLabel) C() C.cudnnFusedOpsVariantParamLabel_t
C returns the C representation of FusedOpsVariantParamLabel
func (FusedOpsVariantParamLabel) String ¶ added in v0.9.4
func (e FusedOpsVariantParamLabel) String() string
type GenStatsMode ¶ added in v0.9.4
type GenStatsMode int
const (
SumSq GenStatsMode = C.CUDNN_GENSTATS_SUM_SQSUM
)
func (GenStatsMode) C ¶ added in v0.9.4
func (e GenStatsMode) C() C.cudnnGenStatsMode_t
C returns the C representation of GenStatsMode
func (GenStatsMode) String ¶ added in v0.9.4
func (e GenStatsMode) String() string
type IndicesType ¶
type IndicesType int
const ( Indices32 IndicesType = C.CUDNN_32BIT_INDICES Indices64 IndicesType = C.CUDNN_64BIT_INDICES Indices16 IndicesType = C.CUDNN_16BIT_INDICES Indices8 IndicesType = C.CUDNN_8BIT_INDICES )
func (IndicesType) C ¶
func (e IndicesType) C() C.cudnnIndicesType_t
C returns the C representation of IndicesType
func (IndicesType) String ¶
func (e IndicesType) String() string
type LRN ¶
type LRN struct {
// contains filtered or unexported fields
}
LRN is a representation of cudnnLRNDescriptor_t.
func (*LRN) C ¶ added in v0.9.4
func (l *LRN) C() C.cudnnLRNDescriptor_t
C returns the internal cgo representation
type LossNormalizationMode ¶ added in v0.9.4
type LossNormalizationMode int
const ( LossNormNone LossNormalizationMode = C.CUDNN_LOSS_NORMALIZATION_NONE LossNormSoftmax LossNormalizationMode = C.CUDNN_LOSS_NORMALIZATION_SOFTMAX )
func (LossNormalizationMode) C ¶ added in v0.9.4
func (e LossNormalizationMode) C() C.cudnnLossNormalizationMode_t
C returns the C representation of LossNormalizationMode
func (LossNormalizationMode) String ¶ added in v0.9.4
func (e LossNormalizationMode) String() string
type MathType ¶
type MathType int
const ( DefaultMath MathType = C.CUDNN_DEFAULT_MATH TensorOpMath MathType = C.CUDNN_TENSOR_OP_MATH TensorOpMathAllowConversion MathType = C.CUDNN_TENSOR_OP_MATH_ALLOW_CONVERSION FmaMath MathType = C.CUDNN_FMA_MATH )
func (MathType) C ¶
func (e MathType) C() C.cudnnMathType_t
C returns the C representation of MathType
type MultiHeadAttnWeightKind ¶ added in v0.9.4
type MultiHeadAttnWeightKind int
const ( QWeights MultiHeadAttnWeightKind = C.CUDNN_MH_ATTN_Q_WEIGHTS KWeights MultiHeadAttnWeightKind = C.CUDNN_MH_ATTN_K_WEIGHTS VWeights MultiHeadAttnWeightKind = C.CUDNN_MH_ATTN_V_WEIGHTS OWeights MultiHeadAttnWeightKind = C.CUDNN_MH_ATTN_O_WEIGHTS QBiases MultiHeadAttnWeightKind = C.CUDNN_MH_ATTN_Q_BIASES KBiases MultiHeadAttnWeightKind = C.CUDNN_MH_ATTN_K_BIASES VBiases MultiHeadAttnWeightKind = C.CUDNN_MH_ATTN_V_BIASES OBiases MultiHeadAttnWeightKind = C.CUDNN_MH_ATTN_O_BIASES )
func (MultiHeadAttnWeightKind) C ¶ added in v0.9.4
func (e MultiHeadAttnWeightKind) C() C.cudnnMultiHeadAttnWeightKind_t
C returns the C representation of MultiHeadAttnWeightKind
func (MultiHeadAttnWeightKind) String ¶ added in v0.9.4
func (e MultiHeadAttnWeightKind) String() string
type NanPropagation ¶
type NanPropagation int
const ( NotPropagateNan NanPropagation = C.CUDNN_NOT_PROPAGATE_NAN PropagateNan NanPropagation = C.CUDNN_PROPAGATE_NAN )
func (NanPropagation) C ¶
func (e NanPropagation) C() C.cudnnNanPropagation_t
C returns the C representation of NanPropagation
func (NanPropagation) String ¶
func (e NanPropagation) String() string
type NormAlgo ¶ added in v0.9.4
type NormAlgo int
const ( StandardNorm NormAlgo = C.CUDNN_NORM_ALGO_STANDARD PersistNorm NormAlgo = C.CUDNN_NORM_ALGO_PERSIST )
func (NormAlgo) C ¶ added in v0.9.4
func (e NormAlgo) C() C.cudnnNormAlgo_t
C returns the C representation of NormAlgo
type NormMode ¶ added in v0.9.4
type NormMode int
const ( NormPerActivation NormMode = C.CUDNN_NORM_PER_ACTIVATION NormPerChannel NormMode = C.CUDNN_NORM_PER_CHANNEL )
func (NormMode) C ¶ added in v0.9.4
func (e NormMode) C() C.cudnnNormMode_t
C returns the C representation of NormMode
type NormOps ¶ added in v0.9.4
type NormOps int
const ( Norm NormOps = C.CUDNN_NORM_OPS_NORM NormActivation NormOps = C.CUDNN_NORM_OPS_NORM_ACTIVATION NormAddActivation NormOps = C.CUDNN_NORM_OPS_NORM_ADD_ACTIVATION )
func (NormOps) C ¶ added in v0.9.4
func (e NormOps) C() C.cudnnNormOps_t
C returns the C representation of NormOps
type Op ¶
type Op struct {
// contains filtered or unexported fields
}
Op is a tuple describing the operation that needs to be done
func NewOp ¶
func NewOp(op OpTensorOp, dt DataType, prop NanPropagation) (*Op, error)
NewOp creates a new Op with the provided settings
func (*Op) NaNPropagation ¶
func (op *Op) NaNPropagation() NanPropagation
NaNPropagation returns the NaN propagation strategy.
type OpTensorOp ¶
type OpTensorOp int
const ( TensorAdd OpTensorOp = C.CUDNN_OP_TENSOR_ADD TensorMul OpTensorOp = C.CUDNN_OP_TENSOR_MUL TensorMin OpTensorOp = C.CUDNN_OP_TENSOR_MIN TensorMax OpTensorOp = C.CUDNN_OP_TENSOR_MAX TensorSqrt OpTensorOp = C.CUDNN_OP_TENSOR_SQRT TensorNot OpTensorOp = C.CUDNN_OP_TENSOR_NOT )
func (OpTensorOp) C ¶
func (e OpTensorOp) C() C.cudnnOpTensorOp_t
C returns the C representation of OpTensorOp
func (OpTensorOp) String ¶
func (e OpTensorOp) String() string
type PointwiseMode ¶ added in v0.9.4
type PointwiseMode int
const ( PointwiseAdd PointwiseMode = C.CUDNN_POINTWISE_ADD PointwiseMul PointwiseMode = C.CUDNN_POINTWISE_MUL PointwiseMin PointwiseMode = C.CUDNN_POINTWISE_MIN PointwiseMax PointwiseMode = C.CUDNN_POINTWISE_MAX PointwiseSqrt PointwiseMode = C.CUDNN_POINTWISE_SQRT PointwiseReluFwd PointwiseMode = C.CUDNN_POINTWISE_RELU_FWD PointwiseTanhFwd PointwiseMode = C.CUDNN_POINTWISE_TANH_FWD PointwiseSigmoidFwd PointwiseMode = C.CUDNN_POINTWISE_SIGMOID_FWD PointwiseEluFwd PointwiseMode = C.CUDNN_POINTWISE_ELU_FWD )
func (PointwiseMode) C ¶ added in v0.9.4
func (e PointwiseMode) C() C.cudnnPointwiseMode_t
C returns the C representation of PointwiseMode
func (PointwiseMode) String ¶ added in v0.9.4
func (e PointwiseMode) String() string
type Pooling ¶
type Pooling struct {
// contains filtered or unexported fields
}
Pooling is a representation of cudnnPoolingDescriptor_t.
func NewPooling ¶
func NewPooling(mode PoolingMode, maxpoolingNanOpt NanPropagation, shape, strides, padding []int) (retVal *Pooling, err error)
NewPooling creates a new Pooling op.
func (*Pooling) CalcOutputShape ¶
func (p *Pooling) CalcOutputShape(input *TensorDescriptor, dims int) (retVal []int, err error)
CalcOutputShape is like OutputShape, but doesn't go through a check for the cached value.
func (*Pooling) Mode ¶
func (p *Pooling) Mode() PoolingMode
Mode returns the Pooling Mode of the pooling operation.
func (*Pooling) NaNPropagation ¶
func (p *Pooling) NaNPropagation() NanPropagation
NaNPropagation returns the NaN propagation strategy when the pooling type is a max pooling.
func (*Pooling) OutputShape ¶
func (p *Pooling) OutputShape(input *TensorDescriptor, dims int) (retVal []int, err error)
OutputShape computes the output shape given the input tensor.
This method caches the outputShape. If a inputTensor is seen before, and the dims is exactly the same, then the cached output shape is used
type PoolingMode ¶
type PoolingMode int
const ( MaxPooling PoolingMode = C.CUDNN_POOLING_MAX AverageCountIncludePadding PoolingMode = C.CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING AverageCountExcludePadding PoolingMode = C.CUDNN_POOLING_AVERAGE_COUNT_EXCLUDE_PADDING MaxDeterministic PoolingMode = C.CUDNN_POOLING_MAX_DETERMINISTIC )
func (PoolingMode) C ¶
func (e PoolingMode) C() C.cudnnPoolingMode_t
C returns the C representation of PoolingMode
func (PoolingMode) String ¶
func (e PoolingMode) String() string
type RNN ¶
type RNN struct {
// contains filtered or unexported fields
}
RNN is a representation of cudnnRNNDescriptor_t.
func (*RNN) DirectionMode ¶
func (r *RNN) DirectionMode() DirectionMode
func (*RNN) HiddenSize ¶
func (*RNN) InputMode ¶
func (r *RNN) InputMode() RNNInputMode
func (*RNN) MatrixMathType ¶
func (*RNN) SetMatrixMathType ¶
type RNNAlgo ¶
type RNNAlgo int
const ( StandardRNN RNNAlgo = C.CUDNN_RNN_ALGO_STANDARD PersistStaticRNN RNNAlgo = C.CUDNN_RNN_ALGO_PERSIST_STATIC PersistDynamicRNN RNNAlgo = C.CUDNN_RNN_ALGO_PERSIST_DYNAMIC CountRNN RNNAlgo = C.CUDNN_RNN_ALGO_COUNT )
type RNNBiasMode ¶ added in v0.9.4
type RNNBiasMode int
const ( RNNNoBias RNNBiasMode = C.CUDNN_RNN_NO_BIAS RNNSingleInpBias RNNBiasMode = C.CUDNN_RNN_SINGLE_INP_BIAS RNNDoubleBias RNNBiasMode = C.CUDNN_RNN_DOUBLE_BIAS RNNSingleRecBias RNNBiasMode = C.CUDNN_RNN_SINGLE_REC_BIAS )
func (RNNBiasMode) C ¶ added in v0.9.4
func (e RNNBiasMode) C() C.cudnnRNNBiasMode_t
C returns the C representation of RNNBiasMode
func (RNNBiasMode) String ¶ added in v0.9.4
func (e RNNBiasMode) String() string
type RNNClipMode ¶ added in v0.9.4
type RNNClipMode int
const ( RNNClipNone RNNClipMode = C.CUDNN_RNN_CLIP_NONE RNNClipMinmax RNNClipMode = C.CUDNN_RNN_CLIP_MINMAX )
func (RNNClipMode) C ¶ added in v0.9.4
func (e RNNClipMode) C() C.cudnnRNNClipMode_t
C returns the C representation of RNNClipMode
func (RNNClipMode) String ¶ added in v0.9.4
func (e RNNClipMode) String() string
type RNNData ¶ added in v0.9.4
type RNNData struct {
// contains filtered or unexported fields
}
RNNData is a representation of cudnnRNNDataDescriptor_t.
func NewRNNData ¶ added in v0.9.4
func NewRNNData(dataType DataType, layout RNNDataLayout, maxSeqLength int, batchSize int, vectorSize int, seqLengthArray []int, paddingFill Memory) (retVal *RNNData, err error)
NewRNNData creates a new RNNData.
func (*RNNData) C ¶ added in v0.9.4
func (r *RNNData) C() C.cudnnRNNDataDescriptor_t
C() returns the internal cgo representation of RNNData
func (*RNNData) Layout ¶ added in v0.9.4
func (r *RNNData) Layout() RNNDataLayout
Layout returns the internal layout.
func (*RNNData) MaxSeqLength ¶ added in v0.9.4
MaxSeqLength returns the internal maxSeqLength.
func (*RNNData) PaddingFill ¶ added in v0.9.4
PaddingFill returns the internal paddingFill.
func (*RNNData) SeqLengthArray ¶ added in v0.9.4
SeqLengthArray returns the internal `seqLengthArray` slice.
func (*RNNData) VectorSize ¶ added in v0.9.4
VectorSize returns the internal vectorSize.
type RNNDataLayout ¶ added in v0.9.4
type RNNDataLayout int
const ( SeqMajorUnpacked RNNDataLayout = C.CUDNN_RNN_DATA_LAYOUT_SEQ_MAJOR_UNPACKED SeqMajorPacked RNNDataLayout = C.CUDNN_RNN_DATA_LAYOUT_SEQ_MAJOR_PACKED BatchMajorUnpacked RNNDataLayout = C.CUDNN_RNN_DATA_LAYOUT_BATCH_MAJOR_UNPACKED )
func (RNNDataLayout) C ¶ added in v0.9.4
func (e RNNDataLayout) C() C.cudnnRNNDataLayout_t
C returns the C representation of RNNDataLayout
func (RNNDataLayout) String ¶ added in v0.9.4
func (e RNNDataLayout) String() string
type RNNInputMode ¶
type RNNInputMode int
const ( LinearInput RNNInputMode = C.CUDNN_LINEAR_INPUT SkipInput RNNInputMode = C.CUDNN_SKIP_INPUT )
func (RNNInputMode) C ¶
func (e RNNInputMode) C() C.cudnnRNNInputMode_t
C returns the C representation of RNNInputMode
func (RNNInputMode) String ¶
func (e RNNInputMode) String() string
type RNNMode ¶
type RNNMode int
const ( RNNReLU RNNMode = C.CUDNN_RNN_RELU RNNTanh RNNMode = C.CUDNN_RNN_TANH LSTM RNNMode = C.CUDNN_LSTM GRU RNNMode = C.CUDNN_GRU )
type ReduceTensorIndices ¶
type ReduceTensorIndices int
const ( ReduceNoIndices ReduceTensorIndices = C.CUDNN_REDUCE_TENSOR_NO_INDICES ReduceFlattenedIndices ReduceTensorIndices = C.CUDNN_REDUCE_TENSOR_FLATTENED_INDICES )
func (ReduceTensorIndices) C ¶
func (e ReduceTensorIndices) C() C.cudnnReduceTensorIndices_t
C returns the C representation of ReduceTensorIndices
func (ReduceTensorIndices) String ¶
func (e ReduceTensorIndices) String() string
type ReduceTensorOp ¶
type ReduceTensorOp int
const ( ReduceAdd ReduceTensorOp = C.CUDNN_REDUCE_TENSOR_ADD ReduceMul ReduceTensorOp = C.CUDNN_REDUCE_TENSOR_MUL ReduceMin ReduceTensorOp = C.CUDNN_REDUCE_TENSOR_MIN ReduceMax ReduceTensorOp = C.CUDNN_REDUCE_TENSOR_MAX ReduceAmax ReduceTensorOp = C.CUDNN_REDUCE_TENSOR_AMAX ReduceAvg ReduceTensorOp = C.CUDNN_REDUCE_TENSOR_AVG ReduceNorm1 ReduceTensorOp = C.CUDNN_REDUCE_TENSOR_NORM1 ReduceNorm2 ReduceTensorOp = C.CUDNN_REDUCE_TENSOR_NORM2 ReduceMulNoZeros ReduceTensorOp = C.CUDNN_REDUCE_TENSOR_MUL_NO_ZEROS )
func (ReduceTensorOp) C ¶
func (e ReduceTensorOp) C() C.cudnnReduceTensorOp_t
C returns the C representation of ReduceTensorOp
func (ReduceTensorOp) String ¶
func (e ReduceTensorOp) String() string
type Reduction ¶
type Reduction struct {
// contains filtered or unexported fields
}
Reduction is a representation of cudnnReduceTensorDescriptor_t.
func NewReduction ¶
func NewReduction(reduceTensorOp ReduceTensorOp, reduceTensorCompType DataType, reduceTensorNanOpt NanPropagation, reduceTensorIndices ReduceTensorIndices, reduceTensorIndicesType IndicesType) (retVal *Reduction, err error)
NewReduction creates a new Reduction.
func (*Reduction) C ¶ added in v0.9.4
func (r *Reduction) C() C.cudnnReduceTensorDescriptor_t
C returns the internal cgo representation.
func (*Reduction) ReduceTensorCompType ¶
ReduceTensorCompType returns the internal reduceTensorCompType.
func (*Reduction) ReduceTensorIndices ¶
func (r *Reduction) ReduceTensorIndices() ReduceTensorIndices
ReduceTensorIndices returns the internal reduceTensorIndices.
func (*Reduction) ReduceTensorIndicesType ¶
func (r *Reduction) ReduceTensorIndicesType() IndicesType
ReduceTensorIndicesType returns the internal reduceTensorIndicesType.
func (*Reduction) ReduceTensorNanOpt ¶
func (r *Reduction) ReduceTensorNanOpt() NanPropagation
ReduceTensorNanOpt returns the internal reduceTensorNanOpt.
func (*Reduction) ReduceTensorOp ¶
func (r *Reduction) ReduceTensorOp() ReduceTensorOp
ReduceTensorOp returns the internal reduceTensorOp.
type ReorderType ¶ added in v0.9.4
type ReorderType int
const ( DefaultReorder ReorderType = C.CUDNN_DEFAULT_REORDER NoReorder ReorderType = C.CUDNN_NO_REORDER )
func (ReorderType) C ¶ added in v0.9.4
func (e ReorderType) C() C.cudnnReorderType_t
C returns the C representation of ReorderType
func (ReorderType) String ¶ added in v0.9.4
func (e ReorderType) String() string
type SamplerType ¶
type SamplerType int
const (
Bilinear SamplerType = C.CUDNN_SAMPLER_BILINEAR
)
func (SamplerType) C ¶
func (e SamplerType) C() C.cudnnSamplerType_t
C returns the C representation of SamplerType
func (SamplerType) String ¶
func (e SamplerType) String() string
type SeqData ¶ added in v0.9.4
type SeqData struct {
// contains filtered or unexported fields
}
SeqData is a representation of cudnnSeqDataDescriptor_t.
func NewSeqData ¶ added in v0.9.4
func NewSeqData(dataType DataType, nbDims int, dimA []int, axes []SeqDataAxis, seqLengthArraySize uintptr, seqLengthArray []int, paddingFill Memory) (retVal *SeqData, err error)
NewSeqData creates a new SeqData.
func (*SeqData) Axes ¶ added in v0.9.4
func (s *SeqData) Axes() []SeqDataAxis
Axes returns the internal axes.
func (*SeqData) C ¶ added in v0.9.4
func (s *SeqData) C() C.cudnnSeqDataDescriptor_t
C() returns the internal cgo representation
func (*SeqData) PaddingFill ¶ added in v0.9.4
PaddingFill returns the internal paddingFill.
func (*SeqData) SeqLengthArray ¶ added in v0.9.4
SeqLengthArray returns the internal `seqLengthArray` slice.
func (*SeqData) SeqLengthArraySize ¶ added in v0.9.4
SeqLengthArraySize returns the internal seqLengthArraySize.
type SeqDataAxis ¶ added in v0.9.4
type SeqDataAxis int
const ( TimeDim SeqDataAxis = C.CUDNN_SEQDATA_TIME_DIM BatchDim SeqDataAxis = C.CUDNN_SEQDATA_BATCH_DIM BeamDim SeqDataAxis = C.CUDNN_SEQDATA_BEAM_DIM VectDim SeqDataAxis = C.CUDNN_SEQDATA_VECT_DIM )
func (SeqDataAxis) C ¶ added in v0.9.4
func (e SeqDataAxis) C() C.cudnnSeqDataAxis_t
C returns the C representation of SeqDataAxis
func (SeqDataAxis) String ¶ added in v0.9.4
func (e SeqDataAxis) String() string
type Severity ¶ added in v0.9.4
type Severity int
const ( Fatal Severity = C.CUDNN_SEV_FATAL Error Severity = C.CUDNN_SEV_ERROR Warning Severity = C.CUDNN_SEV_WARNING Info Severity = C.CUDNN_SEV_INFO )
func (Severity) C ¶ added in v0.9.4
func (e Severity) C() C.cudnnSeverity_t
C returns the C representation of Severity
type SoftmaxAlgorithm ¶
type SoftmaxAlgorithm int
const ( Fast SoftmaxAlgorithm = C.CUDNN_SOFTMAX_FAST Accurate SoftmaxAlgorithm = C.CUDNN_SOFTMAX_ACCURATE Log SoftmaxAlgorithm = C.CUDNN_SOFTMAX_LOG )
func (SoftmaxAlgorithm) C ¶
func (e SoftmaxAlgorithm) C() C.cudnnSoftmaxAlgorithm_t
C returns the C representation of SoftmaxAlgorithm
func (SoftmaxAlgorithm) String ¶
func (e SoftmaxAlgorithm) String() string
type SoftmaxMode ¶
type SoftmaxMode int
const ( Instance SoftmaxMode = C.CUDNN_SOFTMAX_MODE_INSTANCE Channel SoftmaxMode = C.CUDNN_SOFTMAX_MODE_CHANNEL )
func (SoftmaxMode) C ¶
func (e SoftmaxMode) C() C.cudnnSoftmaxMode_t
C returns the C representation of SoftmaxMode
func (SoftmaxMode) String ¶
func (e SoftmaxMode) String() string
type SpatialTransformer ¶
type SpatialTransformer struct {
// contains filtered or unexported fields
}
SpatialTransformer is a representation of cudnnSpatialTransformerDescriptor_t.
func NewSpatialTransformer ¶
func NewSpatialTransformer(samplerType SamplerType, dataType DataType, nbDims int, dimA []int) (retVal *SpatialTransformer, err error)
NewSpatialTransformer creates a new SpatialTransformer.
func (*SpatialTransformer) C ¶ added in v0.9.4
func (s *SpatialTransformer) C() C.cudnnSpatialTransformerDescriptor_t
C() returns the internal C representation of the Spatial Transformer
func (*SpatialTransformer) DataType ¶
func (s *SpatialTransformer) DataType() DataType
DataType returns the internal dataType.
func (*SpatialTransformer) DimA ¶ added in v0.9.4
func (s *SpatialTransformer) DimA() []int
DimA returns the internal `dimA` slice.
func (*SpatialTransformer) NbDims ¶
func (s *SpatialTransformer) NbDims() int
NbDims returns the internal nbDims.
func (*SpatialTransformer) SamplerType ¶
func (s *SpatialTransformer) SamplerType() SamplerType
SamplerType returns the internal samplerType.
type TensorDescriptor ¶
type TensorDescriptor struct {
// contains filtered or unexported fields
}
func NewTensorDescriptor ¶
func NewTensorDescriptor(format TensorFormat, dt DataType, shape, strides []int) (*TensorDescriptor, error)
func (*TensorDescriptor) DataType ¶
func (t *TensorDescriptor) DataType() DataType
func (*TensorDescriptor) DeriveBNTensorDescriptor ¶ added in v0.9.4
func (te *TensorDescriptor) DeriveBNTensorDescriptor(xDesc *TensorDescriptor, mode BatchNormMode) (derivedBnDesc *TensorDescriptor, err error)
DeriveBNTensorDescriptor derives a secondary tensor descriptor for the batch normalization scale, invVariance, bnBias, and bnScale subtensors from the layer's x data descriptor.
func (*TensorDescriptor) DropoutGetReserveSpaceSize ¶
func (te *TensorDescriptor) DropoutGetReserveSpaceSize() (sizeInBytes uintptr, err error)
DropoutGetReserveSpaceSize is used to query the amount of reserve needed to run dropout with the input dimensions given by xDesc. The same reserve space is expected to be passed to cudnnDropoutForward() and cudnnDropoutBackward(), and its contents is expected to remain unchanged between cudnnDropoutForward() and cudnnDropoutBackward() calls.
func (*TensorDescriptor) Format ¶
func (t *TensorDescriptor) Format() TensorFormat
func (*TensorDescriptor) Shape ¶
func (t *TensorDescriptor) Shape() []int
func (*TensorDescriptor) Strides ¶
func (t *TensorDescriptor) Strides() []int
type TensorFormat ¶
type TensorFormat int
const ( NCHW TensorFormat = C.CUDNN_TENSOR_NCHW NHWC TensorFormat = C.CUDNN_TENSOR_NHWC NCHWVectC TensorFormat = C.CUDNN_TENSOR_NCHW_VECT_C )
func (TensorFormat) C ¶
func (e TensorFormat) C() C.cudnnTensorFormat_t
C returns the C representation of TensorFormat
func (TensorFormat) String ¶
func (e TensorFormat) String() string
type TensorTransform ¶ added in v0.9.4
type TensorTransform struct {
// contains filtered or unexported fields
}
TensorTransform is a representation of cudnnTensorTransformDescriptor_t.
func NewTensorTransform ¶ added in v0.9.4
func NewTensorTransform(nbDims uint32, destFormat TensorFormat, padBeforeA []int32, padAfterA []int32, foldA []uint32, direction FoldingDirection) (retVal *TensorTransform, err error)
NewTensorTransform creates a new TensorTransform.
func (*TensorTransform) C ¶ added in v0.9.4
func (t *TensorTransform) C() C.cudnnTensorTransformDescriptor_t
C returns the cgo representation
func (*TensorTransform) DestFormat ¶ added in v0.9.4
func (t *TensorTransform) DestFormat() TensorFormat
DestFormat returns the internal destFormat.
func (*TensorTransform) Direction ¶ added in v0.9.4
func (t *TensorTransform) Direction() FoldingDirection
Direction returns the internal direction.
func (*TensorTransform) FoldA ¶ added in v0.9.4
func (t *TensorTransform) FoldA() []uint32
FoldA returns the internal `foldA` slice.
func (*TensorTransform) NDims ¶ added in v0.9.4
func (t *TensorTransform) NDims() uint32
func (*TensorTransform) PadAfterA ¶ added in v0.9.4
func (t *TensorTransform) PadAfterA() []int32
PadAfterA returns the internal `padAfterA` padding slice.
func (*TensorTransform) PadBeforeA ¶ added in v0.9.4
func (t *TensorTransform) PadBeforeA() []int32
PadBeforeA returns the internal `padBeforeA` padding slice.
type WgradMode ¶ added in v0.9.4
type WgradMode int
const ( Add WgradMode = C.CUDNN_WGRAD_MODE_ADD Set WgradMode = C.CUDNN_WGRAD_MODE_SET )
func (WgradMode) C ¶ added in v0.9.4
func (e WgradMode) C() C.cudnnWgradMode_t
C returns the C representation of WgradMode
Notes ¶
Bugs ¶
the memory for the scratch space isn't freed. This could potentially lead to some issues
Source Files
¶
- cgoflags.go
- convolution.go
- cudnn.go
- dropout.go
- filter.go
- generated_API.go
- generated_activation.go
- generated_algorithmdescriptor.go
- generated_algorithmperformance.go
- generated_attention.go
- generated_backend.go
- generated_ctcloss.go
- generated_enums.go
- generated_enums_strings.go
- generated_fusedopconsts.go
- generated_fusedopvariantparams.go
- generated_lrn.go
- generated_reduction.go
- generated_rnndata.go
- generated_seqdata.go
- generated_spatialtransformer.go
- generated_tensortransform.go
- handle.go
- optensor.go
- pooling.go
- rnn.go
- shape.go
- status.go
- tensor.go
- todo.go