def METHOD_NAME(data: Any) -> Any:
    kwargs = {}
    # Don't issue non-blocking transfers to CPU
    # Same with MPS due to a race condition bug: https://github.com/pytorch/pytorch/issues/83015
    if isinstance(data, Tensor) and isinstance(device, torch.device) and device.type not in _BLOCKING_DEVICE_TYPES:
        kwargs["non_blocking"] = True
    data_output = data.to(device, **kwargs)
    if data_output is not None:
        return data_output
    # user wrongly implemented the `_TransferableDataType` and forgot to return `self`.
    return data