code: func NewSpatialTransformer(samplerType SamplerType, dataType DataType, nbDims int, dimA []int) (retVal *SpatialTransformer, err error) {
  	var internal C.cudnnSpatialTransformerDescriptor_t
  	if err := result(C.cudnnCreateSpatialTransformerDescriptor(&internal)); err != nil {
  		return nil, err
  	}
  
  	dimAC, dimACManaged := ints2CIntPtr(dimA)
  	defer returnManaged(dimACManaged)
  	if err := result(C.cudnnSetSpatialTransformerNdDescriptor(internal, samplerType.C(), dataType.C(), C.int(nbDims), dimAC)); err != nil {
  		return nil, err
  	}
  
  	retVal = &SpatialTransformer{
  		internal:    internal,
  		samplerType: samplerType,
  		dataType:    dataType,
  		nbDims:      nbDims,
  		dimA:        dimA,
  	}
  	runtime.SetFinalizer(retVal, destroySpatialTransformer)
  	return retVal, nil
  }
docs: // NewSpatialTransformer creates a new SpatialTransformer.