I have tried the line as
labels_batch = torch.FloatTensor(labels_batch.wiew(-1,self.num_classes).numpy(), requires_grad=True)
but, there is the problem as follows
There is only one GPU
Traceback (most recent call last):
File “train.py”, line 123, in 
test_train.start_train(epoch=30,batch_display=2000,batch_size=50,save_freq=1)
File “train.py”, line 85, in start_train
labels_batch = torch.FloatTensor(labels_batch.view(-1,self.num_classes).numpy(), requires_grad=True)
TypeError: new() received an invalid combination of arguments - got (numpy.ndarray, requires_grad=bool), but expected one of:

(torch.device device)
(tuple of ints size, torch.device device)
didn’t match because some of the keywords were incorrect: requires_grad
(torch.Storage storage)
(Tensor other)
(object data, torch.device device)
didn’t match because some of the keywords were incorrect: requires_grad

Can you plz help me solve it?