If you need to use cupy in order to run a kernel, like in szagoruyko’s gist, what Soumith posted is what you want. But that doesn’t create a full-fledged cupy ndarray object; to do that you’d need to replicate the functionality of torch.tensor.numpy(). In particular you need to account for the fact that numpy/cupy strides use bytes while torch strides use element counts; other than that you can use the same memory pointer etc.