def train_batch(sess, model, batch_data):
    """
    Given a Tensorflow session, train the provided model on a single batch.

    Args:
        sess: a Tensorflow session
        model: an Attalos model
        batch_data: a batch generated by model.to_batches

    Returns:
        Training loss for this batch.
    """
    fetches, feed_dict = batch_data
    fetches = model.fit(sess, fetches, feed_dict)
    return fetches