PyTorch create tensors directly on device
Creating PyTorch tensors on the CPU and then moving them to the device impacts the performance.
def pytorch_create_tensors_directly_on_device_noncompliant():
    import torch
    t = torch.ones(list(range(1, 11)), dtype=torch.float64)
    # Noncompliant: tensor is created on cpu and then moved to device.
    t.cuda()
def pytorch_create_tensors_directly_on_device_compliant():
    import torch
    # Compliant: tensor is directly created on device.
    t = torch.tensor([1, 2, 3, 4], device="cuda")