def prepare_batch(harn, raw_batch):
    """
        ensure batch is in a standardized structure

        Overload Encouraged, but not always necessary

        Args:
            raw_batch (object): the raw batch generated by the loader

        Returns:
            object: batch - the prepared batch where relevant inputs have
                been moved onto the appropriate XPU(s).

        Notes:
            In the future the default behavior of this will change to simply
            return the raw batch without moving to the XPU. This may be
            necessary to support distributed training.
        """
    batch = raw_batch
    import warnings
    warnings.warn(
        'The behavior of prepare_batch will change in the future. The new behavior will be a simple no-op For maximum compatibility override prepare_batch.'
        , DeprecationWarning)
    try:
        if isinstance(raw_batch, (tuple, list)):
            batch_inputs, batch_labels = raw_batch
            raw_batch = {'input': batch_inputs, 'label': batch_labels}
        if isinstance(raw_batch, dict):
            batch = raw_batch.copy()
            batch = harn.xpu.move(batch)
        else:
            print('ERROR: raw_batch = {}'.format(type(raw_batch)))
            raise TypeError('could not prepare raw batch {}'.format(type(
                raw_batch)))
    except Exception:
        harn.warn(
            'Error occurred in default prepare_batch. Perhaps you should overload it?'
            )
        raise
    return batch
