I have some code that runs fine on my laptop (macOS, 2.3 GHz Intel Core i5, 16 GB memory), but fails on a GPU. On my laptop, I can run this fine:
>>> import torch
>>> x = torch.randn(70000, 16)
>>> y = torch.randn(16, 70000)
>>> z = torch.matmul(x, y)

But when I try to run this same code on a GPU, it fails:
>>> import torch
>>> device = torch.cuda.current_device()
>>> x = torch.randn(70000, 16).to(device)
>>> y = torch.randn(16, 70000).to(device)
>>> z = torch.matmul(x, y)
THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1524584710464/work/aten/src/THC/generic/THCStorage.cu line=58 error=2 : out of memory
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: cuda runtime error (2) : out of memory at /opt/conda/conda-bld/pytorch_1524584710464/work/aten/src/THC/generic/THCStorage.cu:58

Any reason why and any way I can get this to run on a GPU?