How to convert ndarray to autograd variable in GPU format?
I am trying to do something like this,

data = torch.autograd.Variable(torch.from_numpy(nd_array))

It comes under the type as Variable[torch.FloatTensor], But I need Variable[torch.cuda.FloatTensor] also I want to do this in pytorch version 0.3.0 which lacks few methods like to(device) or set_default_device

You can use cuda() method of your tensor.

If you'd like to use specific device you could go with context manager, e.g.

with torch.cuda.device(device_index):
    t = torch.FloatTensor(1.).cuda()


For more specific information check documentation for version 0.3.0.
