code: func (co *Context) RNNBackwardWeights(rnnDesc *RNN, seqLength int, xDesc []*TensorDescriptor, x Memory, hxDesc *TensorDescriptor, hx Memory, yDesc []*TensorDescriptor, y Memory, workspace Memory, workSpaceSizeInBytes uintptr, dwDesc *Filter, dw Memory, reserveSpace Memory, reserveSpaceSizeInBytes uintptr) error {
  	internals := make([]C.cudnnTensorDescriptor_t, len(xDesc))
  	for i := range xDesc {
  		internals[i] = xDesc[i].internal
  	}
  	ptr := (*C.cudnnTensorDescriptor_t)(unsafe.Pointer(&internals[0]))
  
  	yDescInternals := make([]C.cudnnTensorDescriptor_t, len(xDesc))
  	for i := range yDesc {
  		yDescInternals[i] = yDesc[i].internal
  	}
  	yDescPtr := (*C.cudnnTensorDescriptor_t)(unsafe.Pointer(&yDescInternals[0]))
  
  	// call cudnnRNNBackwardWeights
  	return result(C.cudnnRNNBackwardWeights(co.internal, rnnDesc.internal, C.int(seqLength), ptr, x.Pointer(), hxDesc.internal, hx.Pointer(), yDescPtr, y.Pointer(), workspace.Pointer(), C.size_t(workSpaceSizeInBytes), dwDesc.internal, dw.Pointer(), reserveSpace.Pointer(), C.size_t(reserveSpaceSizeInBytes)))
  }
docs: // RNNBackwardWeights accumulates weight gradients dw from the recurrent neural network described by rnnDesc with inputs x, hx, and outputs y. The mode of operation in this case is additive, the weight gradients calculated will be added to those already existing in dw. workspace is required for intermediate storage. The data in reserveSpace must have previously been generated by cudnnRNNBackwardData.
  //	dw is both an input and output