is there any way to specify memory location when copy a cuda tensor to cpu? In numpy we can specify out=destination
for some functions, is there similar functionality for pytorch, maybe like:
destination = np.empty(shape=(...very_large_n...)
cuda_tesnor.cpu(out=destination[some_slice])
I’v tried
destination[some_slice] = cuda_tensor.cpu().data.numpy()
found that is used twice time as purely tensor.cpu().data.numpy()
, so I suggest it copied two times.