I am actually trying to implement the codes here 5:
print(">", all_loss)
> {'train': tensor([0.], device='cuda:0'), 'valid': tensor([0.], device='cuda:0')}

print(">>", all_loss[phase], type(all_loss[phase]))
>> tensor([0.], device='cuda:0') <class 'torch.Tensor'>

print(">>>", loss.detach().view(1, -1), type(loss.detach().view(1, -1)), loss.detach().view(1, -1).dtype)
>>> tensor([[0.5484]], device='cuda:0') <class 'torch.Tensor'> torch.float32