def METHOD_NAME(obj):
    """
    Move all contents of a dataclass to cpu inplace if supported.
    Args:
        batch: Input dataclass.
    Returns:
        batch_cuda: `batch` moved to a cpu device, if supported.
    """
    for f in dataclasses.fields(obj):
        setattr(obj, f.name, try_to_cpu(getattr(obj, f.name)))
    return obj