Solved by Alpha in post #2 
              
              
                Hi 
you need to change the data type of a from in to float or doule, i.e ,you can try this: 

a =1.0 * np.random.randint(0,3,size=(10)) 
v = Variable(torch.from_numpy(a)) 
F.softmax(v)