UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).
target = torch.tensor(target, dtype=torch.long)
target = torch.tensor(target, dtype=torch.long)
target = torch.as_tensor(target, dtype=torch.long)