def prepare_batch(batch, graph, device):
    """
    Prepares a batch to directly feed a model with.

    Args:
        batch (tuple): batch tuple containing the image and the target.
        graph (`Graph`): graph.
        device (`torch.device`): computation device.

    Returns:
        (`torch.Tensor`): image.
        (`torch.Tensor`): target.
    """
    image, target = batch

    if hasattr(graph, "sub_vertex_indices"):
        return image[..., graph.sub_vertex_indices].to(device), target.to(device)

    return image.to(device), target.to(device)