Element-Research / dpnn

deep extensions to nn
BSD 3-Clause "New" or "Revised" License
194 stars 82 forks source link

Illegal Memory Access When Using OneHot with CUDA #71

Open ari-holtzman opened 8 years ago

ari-holtzman commented 8 years ago

This code:

require 'cutorch' require 'dpnn' local v = torch.CudaTensor.zeros(torch.CudaTensor.new(), 5) v[3] = 1 local one_hot = nn.OneHot(5):cuda() one_hot:forward(v)

Gives me this error:

THCudaCheck FAIL file=/tmp/luarocks_cutorch-scm-1-75/cutorch/lib/THC/generic/THCStorage.c line=147 error=77 : an illegal memory access was encountered

Am I missing something really, really obvious or is this a really weird bug?