def METHOD_NAME(tensor):
    """
    Ensure NUM_MANTISSA_BITS is copied to the same device as tensor (only once)
    """
    global NUM_MANTISSA_BITS  # pylint: disable=global-statement
    if not isinstance(NUM_MANTISSA_BITS, torch.Tensor):
        NUM_MANTISSA_BITS = torch.Tensor([NUM_MANTISSA_BITS]).to(tensor.device)