code: func (ctx *BatchedContext) Cleanup() {
  	for i, f := range ctx.frees {
  		C.free(f)
  		ctx.frees[i] = nil
  	}
  	ctx.frees = ctx.frees[:0]
  }
docs: // Cleanup is the cleanup function. It cleans up all the ancilliary allocations that has happened for all the batched calls.
  // This method should be called when the context is done with - otherwise there'd be a lot of leaked memory.
  //
  // The main reason why this method exists is because there is no way to reliably free memory without causing weird issues in the CUDA calls.