I don’t think this is a problem of numpy to cuda variable.
The softmax function requires a 2D Tensor as input and I guess you are giving a single
vector as input.
Please go through the documentation of Softmax:  http://pytorch.org/docs/master/nn.html#torch.nn.Softmax 27