def train_loop(model, optimizer, loss_fn, samples, labels,
               batch_size, seq_len, device='cpu', pre_trained=False):
    """
    Standard pytorch training loop, using our helper loss function above.
    :param model: model to optimize
    :param optimizer: optimizer
    :param loss_fn: loss function
    :param samples: data in
    :param labels: labels out
    :param batch_size: batch size for sequences
    :param seq_len: sequence length
    :param device: device to put tensors on
    :param pre_trained: are we using pre-made embeddings or passing in indices?
    :return: model, loss, and accuracy
    """
    loss_total = 0
    acc_total = 0
    total_samples = 0
    # iterate through all samples, stepping by batch_size * sequence length and using
    # your loss function above to calculate loss. Then, zero gradients, backprop, step optimizer, and repeat
    # Also, store up the loss total, total number correct, and total number processed by the model so far

    # Return model, loss, and accuracy
    return model, loss_total, acc_total/total_samples